Skip to content

Commit 30f41c7

Browse files
fix: cert cleanup process (#460)
1 parent d9373d4 commit 30f41c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

legacy/build-deploy-docker-compose.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ function cleanupCertificates() {
196196
# check if it is a lets encrypt certificate
197197
if openssl x509 -in <(kubectl -n ${NAMESPACE} get secret ${TLS_SECRET} -o json | jq -r '.data."tls.crt" | @base64d') -text -noout | grep -o -q "Let's Encrypt" &> /dev/null; then
198198
# don't block execution
199-
kubectl -n ${NAMESPACE} delete secret ${TLS_SECRET} &> /dev/null
199+
kubectl -n ${NAMESPACE} delete secret ${TLS_SECRET} &> /dev/null || true
200200
fi
201201
fi
202202
fi
203203
# delete the certmanager certificate to prevent renewals
204-
kubectl -n ${NAMESPACE} delete certificates.cert-manager.io ${TLS_SECRET} &> /dev/null
204+
kubectl -n ${NAMESPACE} delete certificates.cert-manager.io ${TLS_SECRET} &> /dev/null || true
205205
done
206206
}
207207

@@ -1750,7 +1750,7 @@ fi
17501750
# remove any certificates for tls-acme false ingress to prevent reissuing attempts
17511751
TLS_FALSE_INGRESSES=$(kubectl -n ${NAMESPACE} get ingress -o json | jq -r '.items[] | select(.metadata.annotations["kubernetes.io/tls-acme"] == "false") | .metadata.name')
17521752
for TLS_FALSE_INGRESS in $TLS_FALSE_INGRESSES; do
1753-
cleanupCertificates "${DI}" "true"
1753+
cleanupCertificates "${TLS_FALSE_INGRESS}" "true"
17541754
done
17551755

17561756
currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")"

0 commit comments

Comments
 (0)