Skip to content

Commit dfd5406

Browse files
fix: ignore acme challenge ingress in cleanup (#282)
1 parent bd3ba28 commit dfd5406

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

legacy/build-deploy-docker-compose.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ beginBuildStep "Route/Ingress Cleanup" "cleanupRoutes"
12701270

12711271
set +x
12721272
# collect the current routes, its possible to exclude ingress by adding a label 'route.lagoon.sh/remove=false' and it won't get deleted
1273-
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)
1273+
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)
12741274
# collect the routes that Lagoon thinks it should have based on the .lagoon.yml and any routes that have come from the api
12751275
# using the build-deploy-tool generator
12761276
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
13401340
fi
13411341

13421342
# Load all routes with correct schema and comma separated
1343-
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}}')
1343+
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}}')
13441344

13451345
# swap dioscuri for activestanby label
13461346
for ingress in $(kubectl -n ${NAMESPACE} get ingress -l "dioscuri.amazee.io/migrate" -o json | jq -r '.items[] | @base64'); do

0 commit comments

Comments
 (0)