From dfd540684e3be257d6047188533eaa40ab37152e Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 22 Dec 2023 09:02:37 +1100 Subject: [PATCH] fix: ignore acme challenge ingress in cleanup (#282) --- legacy/build-deploy-docker-compose.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/build-deploy-docker-compose.sh b/legacy/build-deploy-docker-compose.sh index 3313941e..2a66298d 100755 --- a/legacy/build-deploy-docker-compose.sh +++ b/legacy/build-deploy-docker-compose.sh @@ -1270,7 +1270,7 @@ beginBuildStep "Route/Ingress Cleanup" "cleanupRoutes" set +x # collect the current routes, its possible to exclude ingress by adding a label 'route.lagoon.sh/remove=false' and it won't get deleted -CURRENT_ROUTES=$(kubectl -n ${NAMESPACE} get ingress -l "route.lagoon.sh/remove!=false" -l "lagoon.sh/autogenerated!=true" --no-headers | cut -d " " -f 1 | xargs) +CURRENT_ROUTES=$(kubectl -n ${NAMESPACE} get ingress -l "route.lagoon.sh/remove!=false" -l "lagoon.sh/autogenerated!=true" -l "acme.cert-manager.io/http01-solver!=true" --no-headers | cut -d " " -f 1 | xargs) # collect the routes that Lagoon thinks it should have based on the .lagoon.yml and any routes that have come from the api # using the build-deploy-tool generator YAML_ROUTES_TO_JSON=$(build-deploy-tool identify created-ingress | jq -r '.secondary[]') @@ -1340,7 +1340,7 @@ if [[ "$CUSTOM_ROUTES_DISABLED" == true ]] && [[ "$AUTOGEN_ROUTES_DISABLED" == t fi # Load all routes with correct schema and comma separated -ROUTES=$(kubectl -n ${NAMESPACE} get ingress --sort-by='{.metadata.name}' -l "acme.openshift.io/exposer!=true" -o=go-template --template='{{range $indexItems, $ingress := .items}}{{if $indexItems}},{{end}}{{$tls := .spec.tls}}{{range $indexRule, $rule := .spec.rules}}{{if $indexRule}},{{end}}{{if $tls}}https://{{else}}http://{{end}}{{.host}}{{end}}{{end}}') +ROUTES=$(kubectl -n ${NAMESPACE} get ingress --sort-by='{.metadata.name}' -l "acme.cert-manager.io/http01-solver!=true" -o=go-template --template='{{range $indexItems, $ingress := .items}}{{if $indexItems}},{{end}}{{$tls := .spec.tls}}{{range $indexRule, $rule := .spec.rules}}{{if $indexRule}},{{end}}{{if $tls}}https://{{else}}http://{{end}}{{.host}}{{end}}{{end}}') # swap dioscuri for activestanby label for ingress in $(kubectl -n ${NAMESPACE} get ingress -l "dioscuri.amazee.io/migrate" -o json | jq -r '.items[] | @base64'); do