Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove the secret when tls-acme is set to false #291

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion legacy/build-deploy-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1931,8 +1931,12 @@ TLS_FALSE_INGRESSES=$(kubectl -n ${NAMESPACE} get ingress -o json | jq -r '.item
for TLS_FALSE_INGRESS in $TLS_FALSE_INGRESSES; do
TLS_SECRETS=$(kubectl -n ${NAMESPACE} get ingress ${TLS_FALSE_INGRESS} -o json | jq -r '.spec.tls[]?.secretName')
for TLS_SECRET in $TLS_SECRETS; do
echo ">> Cleaning up certificate for ${TLS_SECRET} as tls-acme is set to false"
shreddedbacon marked this conversation as resolved.
Show resolved Hide resolved
# check if it is a lets encrypt certificate
if openssl x509 -in <(kubectl -n ${NAMESPACE} get secret ${TLS_SECRET}-tls -o json | jq -r '.data."tls.crt"' | base64 --decode) -text -noout | grep -o -q "Let's Encrypt" s &> /dev/null; then
kubectl -n ${NAMESPACE} delete secret ${TLS_SECRET}-tls
fi
if kubectl -n ${NAMESPACE} get certificates.cert-manager.io ${TLS_SECRET} &> /dev/null; then
echo ">> Cleaning up certificate for ${TLS_SECRET} as tls-acme is set to false"
kubectl -n ${NAMESPACE} delete certificates.cert-manager.io ${TLS_SECRET}
fi
done
Expand Down
Loading