Skip to content

Commit

Permalink
ROX-19905: Install new CRDs if the previous chart revision didn't con…
Browse files Browse the repository at this point in the history
…tain them (#1430)
  • Loading branch information
kovayur authored Nov 2, 2023
1 parent a71d1d6 commit daba3f4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/lib/helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function invoke_helm() {
local -r release="${1}"
shift

helm repo add external-secrets "https://charts.external-secrets.io/"
helm repo add external-secrets "https://charts.external-secrets.io/" --force-update

# Build the external dependencies like the external-secrets helm chart bundle.
helm dependencies build "${dir}"
Expand All @@ -18,6 +18,16 @@ function invoke_helm() {
else
if [[ "${HELM_DRY_RUN:-}" == "true" ]]; then
HELM_FLAGS="--dry-run"
else
# Install CRDs if they did not exist in the previous revisions or update them
# This is necessary because Helm treats CRDs differently.
# Links:
# - https://helm.sh/docs/chart_best_practices/custom_resource_definitions
# - https://github.com/helm/community/blob/main/hips/hip-0011.md
# - https://github.com/helm/helm/issues/11969
if [ -d "${dir}/crds" ]; then
kubectl apply -f "${dir}/crds"
fi
fi
if [[ "${HELM_DEBUG:-}" == "true" ]]; then
HELM_FLAGS="${HELM_FLAGS:-} --debug"
Expand Down

0 comments on commit daba3f4

Please sign in to comment.