Browse Source

Do not use 'exit' in the script

The scripts in kube_cluster_config SoftwareConfig resource are combined
together as one script inside the VM, any 'exit' clause will stop
executing the following script.

Change-Id: I25965c663e6e1ca5a59d0f28098174810bd76df1
changes/06/631106/1
Lingxian Kong 3 years ago
parent
commit
49d0444974
  1. 25
      magnum/drivers/common/templates/kubernetes/fragments/kube-apiserver-to-kubelet-role.sh

25
magnum/drivers/common/templates/kubernetes/fragments/kube-apiserver-to-kubelet-role.sh

@ -78,22 +78,17 @@ subjects:
namespace: kube-system
EOF
}
kubectl apply --validate=false -f ${ADMIN_RBAC}
if [ -z "${TRUST_ID}" ] || [ "$(echo "${CLOUD_PROVIDER_ENABLED}" | tr '[:upper:]' '[:lower:]')" != "true" ]; then
exit 0
fi
#TODO: add heat variables for master count to determine leaderelect true/False ?
if [ -n "${TRUST_ID}" ] && [ "$(echo "${CLOUD_PROVIDER_ENABLED}" | tr '[:upper:]' '[:lower:]')" = "true" ]; then
occm_image="${CONTAINER_INFRA_PREFIX:-docker.io/k8scloudprovider/}openstack-cloud-controller-manager:${CLOUD_PROVIDER_TAG}"
OCCM=/srv/magnum/kubernetes/openstack-cloud-controller-manager.yaml
occm_image="${CONTAINER_INFRA_PREFIX:-docker.io/k8scloudprovider/}openstack-cloud-controller-manager:${CLOUD_PROVIDER_TAG}"
OCCM=/srv/magnum/kubernetes/openstack-cloud-controller-manager.yaml
[ -f ${OCCM} ] || {
echo "Writing File: ${OCCM}"
mkdir -p $(dirname ${OCCM})
cat << EOF > ${OCCM}
[ -f ${OCCM} ] || {
echo "Writing File: ${OCCM}"
mkdir -p $(dirname ${OCCM})
cat << EOF > ${OCCM}
---
apiVersion: v1
kind: ServiceAccount
@ -317,7 +312,9 @@ spec:
nodeSelector:
node-role.kubernetes.io/master: ""
EOF
}
}
kubectl apply -f ${OCCM}
fi
kubectl create -f ${OCCM}
printf "Finished running ${step}\n"
Loading…
Cancel
Save