Merge "Ceph: update namespace client key script to hard fail sucessfully"

This commit is contained in:
Jenkins 2017-08-25 13:26:47 +00:00 committed by Gerrit Code Review
commit d76fe73b40

View File

@ -20,6 +20,9 @@ set -ex
ceph_activate_namespace() { ceph_activate_namespace() {
kube_namespace=$1 kube_namespace=$1
CEPH_KEY=$(kubectl get secret ${PVC_CEPH_STORAGECLASS_ADMIN_SECRET_NAME} \
--namespace=${PVC_CEPH_STORAGECLASS_DEPLOYED_NAMESPACE} \
-o json | jq -r '.data | .[]')
{ {
cat <<EOF cat <<EOF
apiVersion: v1 apiVersion: v1
@ -29,9 +32,7 @@ metadata:
type: kubernetes.io/rbd type: kubernetes.io/rbd
data: data:
key: | key: |
$(kubectl get secret ${PVC_CEPH_STORAGECLASS_ADMIN_SECRET_NAME} \ $(echo ${CEPH_KEY})
--namespace=${PVC_CEPH_STORAGECLASS_DEPLOYED_NAMESPACE} \
-o json | jq -r '.data | .[]')
EOF EOF
} | kubectl create --namespace ${kube_namespace} -f - } | kubectl create --namespace ${kube_namespace} -f -
} }