Skip to content

Commit

Permalink
release: add migration script for setting nginx annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajarmar authored and simonklb committed Jun 19, 2024
1 parent 5994256 commit 78d723b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions migration/v0.39/prepare/70-set-nginx-annotations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

HERE="$(dirname "$(readlink -f "${0}")")"
ROOT="$(readlink -f "${HERE}/../../../")"

# shellcheck source=scripts/migration/lib.sh
source "${ROOT}/scripts/migration/lib.sh"

if [[ "${CK8S_CLUSTER}" =~ ^(sc|wc|both)$ ]]; then
service_enabled=$(yq_dig common .ingressNginx.controller.service.enabled)
if [[ "${service_enabled}" != "true" ]]; then
log_info "ingress-nginx service not enabled, skipping"
exit 0
fi

annotations=$(yq_dig common .ingressNginx.controller.service.annotations)
if [[ ! "${annotations}" =~ ^set\-me ]]; then
log_info "ingress-nginx annotations are already set, skipping"
exit 0
fi

log_info "setting ingress-nginx annotations to empty object"
yq_add common .ingressNginx.controller.service.annotations {}
fi

0 comments on commit 78d723b

Please sign in to comment.