Skip to content

Commit

Permalink
changed the kubectl commands
Browse files Browse the repository at this point in the history
  • Loading branch information
balciiberk committed Dec 15, 2023
1 parent 5492141 commit b210b3f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion update-trust-anchors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ fi

if [ -n "${CA_BUNDLE_SECRET_TARGET}" ]; then
echo "Copying ca bundle to ${CA_BUNDLE_SECRET_TARGET}"
kubectl create secret generic ca-secret --from-file=ca.crt=$DEST/pem/tls-ca-bundle-all.pem --dry-run=client -o yaml | kubectl apply -f -

if kubectl get secret "$CA_BUNDLE_SECRET_TARGET" 2>/dev/null; then
kubectl create secret generic "$CA_BUNDLE_SECRET_TARGET" --from-file=ca.crt=$DEST/pem/tls-ca-bundle-all.pem --dry-run=client -o yaml | kubectl re
place -f -
echo "Secret '$CA_BUNDLE_SECRET_TARGET' updated."
else
kubectl create secret generic "$CA_BUNDLE_SECRET_TARGET" --from-file=ca.crt=$DEST/pem/tls-ca-bundle-all.pem
echo "Secret '$CA_BUNDLE_SECRET_TARGET' created."
fi

fi

if [ $# -gt 0 ]; then
Expand Down

0 comments on commit b210b3f

Please sign in to comment.