Merge pull request #10173 from subhamkrai/fix-deploy-vault

ci: wait for cert while deploying vault
This commit is contained in:
Sébastien Han authored and GitHub committed 2022-04-27 11:51:02 +02:00
commit 4ea8cc6224
1 file changed
+7
+7
View File
@@ -74,6 +74,13 @@ kubectl create -f "${DIR}/"csr.yaml
kubectl certificate approve "${CSR_NAME}"
timeout 10 bash <<-'EOF'
until [ $(kubectl get csr "${CSR_NAME}" -o jsonpath='{.status.certificate}' | wc -c) -gt 1 ]; do
echo "waiting for certificate "${CSR_NAME}" to be filled"
sleep 1
done
EOF
serverCert=$(kubectl get csr "${CSR_NAME}" -o jsonpath='{.status.certificate}')
echo "${serverCert}" | openssl base64 -d -A -out "${DIR}"/"${SERVICE}".crt
kubectl config view --raw --minify --flatten -o jsonpath='{.clusters[].cluster.certificate-authority-data}' | base64 -d > "${DIR}"/"${SERVICE}".ca