Skip to content

Commit

Permalink
Merge pull request #247 from crawford/cleanup
Browse files Browse the repository at this point in the history
modules: services shouldn't remain after exit
  • Loading branch information
openshift-merge-robot committed Sep 13, 2018
2 parents d4ad90d + d94b979 commit 261657a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
1 change: 0 additions & 1 deletion modules/bootkube/resources/bootkube.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Wants=kubelet.service
After=kubelet.service

[Service]
RemainAfterExit=true
WorkingDirectory=/opt/tectonic

ExecStart=/opt/tectonic/bootkube.sh
Expand Down
19 changes: 9 additions & 10 deletions modules/bootkube/resources/bootkube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

mkdir --parents /etc/kubernetes/manifests/

if [ ! -d "$PWD/kco-bootstrap" ]
if [ ! -d kco-bootstrap ]
then
echo "Rendering Kubernetes core manifests..."

Expand All @@ -15,13 +15,12 @@ then
--config=/assets/kco-config.yaml \
--output=/assets/kco-bootstrap

cp --recursive "$PWD/kco-bootstrap/bootstrap-configs" /etc/kubernetes/bootstrap-configs
cp --recursive "$PWD/kco-bootstrap/bootstrap-configs" .
cp --recursive "$PWD/kco-bootstrap/bootstrap-manifests" .
cp --recursive "$PWD/kco-bootstrap/manifests" .
cp --recursive kco-bootstrap/bootstrap-configs /etc/kubernetes/bootstrap-configs
cp --recursive kco-bootstrap/bootstrap-manifests .
cp --recursive kco-bootstrap/manifests .
fi

if [ ! -d "$PWD/mco-bootstrap" ]
if [ ! -d "mco-bootstrap" ]
then
echo "Rendering MCO manifests..."

Expand All @@ -42,13 +41,13 @@ then
# 2. read the default MachineConfigPools rendered by MachineConfigOperator
# 3. read any additional MachineConfigs that are needed for the default MachineConfigPools.
mkdir --parents /etc/mcc/bootstrap/
cp --recursive "$PWD/mco-bootstrap/manifests" /etc/mcc/bootstrap/manifests
cp "$PWD/mco-bootstrap/machineconfigoperator-bootstrap-pod.yaml" /etc/kubernetes/manifests/
cp --recursive mco-bootstrap/manifests /etc/mcc/bootstrap/manifests
cp mco-bootstrap/machineconfigoperator-bootstrap-pod.yaml /etc/kubernetes/manifests/

# /etc/ssl/mcs/tls.{crt, key} are locations for MachineConfigServer's tls assets.
mkdir --parents /etc/ssl/mcs/
cp "$PWD/tls/machine-config-server.crt" /etc/ssl/mcs/tls.crt
cp "$PWD/tls/machine-config-server.key" /etc/ssl/mcs/tls.key
cp tls/machine-config-server.crt /etc/ssl/mcs/tls.crt
cp tls/machine-config-server.key /etc/ssl/mcs/tls.key
fi

# We originally wanted to run the etcd cert signer as
Expand Down
1 change: 0 additions & 1 deletion modules/tectonic/resources/tectonic.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Wants=bootkube.service
After=bootkube.service

[Service]
RemainAfterExit=true
WorkingDirectory=/opt/tectonic/tectonic

ExecStart=/opt/tectonic/tectonic.sh /opt/tectonic/auth/kubeconfig
Expand Down
6 changes: 3 additions & 3 deletions modules/tectonic/resources/tectonic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
KUBECONFIG="$1"

kubectl() {
(>&2 echo "Executing kubectl $*")
echo "Executing kubectl $*" >&2
while true
do
set +e
Expand All @@ -14,7 +14,7 @@ kubectl() {

if grep --quiet "AlreadyExists" <<< "$out"
then
(>&2 echo "$out, skipping")
echo "$out, skipping" >&2
return
fi

Expand All @@ -24,7 +24,7 @@ kubectl() {
return
fi

(>&2 echo "kubectl $* failed. Retrying in 5 seconds...")
echo "kubectl $* failed. Retrying in 5 seconds..." >&2
sleep 5
done
}
Expand Down

0 comments on commit 261657a

Please sign in to comment.