From 41ba708ab24e50f23958af92a9980e155c4300e9 Mon Sep 17 00:00:00 2001 From: Laszlo Uveges Date: Mon, 13 Nov 2023 12:59:01 +0100 Subject: [PATCH] Bump `kustomize` to `v5.0.3` used by our current KC deployment and move back to `patchesStrategicMerge` because of upstream bug + how we render kustomizations locally (#68) When we render locally or on CI we append vaultless patches to `patchesStrategicMerge` directly into Flux v2 app GS ksutomization. We have to append there because of upstream bug in kustomize that it cannot handle patch files with multiple documents and Flux still uses such a version. For provider specific kustomizations it worked fine, because the vaultless patch was applied later. But if they are in the same file, it seems `patchesStrategicMerge` is applied before `patches` which renders an incorrect result. We should keep these - and ones modifying the same resources - in `patchesStrategicMerge` until Flux bumps to a `kustomize` version that has the bug fix. --- bases/flux-app-v2/giantswarm/kustomization.yaml | 6 ++++-- bases/tools/Makefile.custom.mk | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bases/flux-app-v2/giantswarm/kustomization.yaml b/bases/flux-app-v2/giantswarm/kustomization.yaml index 5fb7a2e..b04cbe9 100644 --- a/bases/flux-app-v2/giantswarm/kustomization.yaml +++ b/bases/flux-app-v2/giantswarm/kustomization.yaml @@ -157,8 +157,10 @@ patches: - --enable-leader-election - --storage-path=/data - "--storage-adv-addr=source-controller.$(RUNTIME_NAMESPACE).svc" -- path: patch-pvc-psp.yaml -- path: patch-kustomize-controller.yaml +# Keeping this because of vaultless helper + upstream bug in kustomize to apply patch files with multiple documents +patchesStrategicMerge: +- patch-pvc-psp.yaml +- patch-kustomize-controller.yaml resources: - resource-namespace.yaml - resource-rbac.yaml diff --git a/bases/tools/Makefile.custom.mk b/bases/tools/Makefile.custom.mk index 7bf1790..813116f 100644 --- a/bases/tools/Makefile.custom.mk +++ b/bases/tools/Makefile.custom.mk @@ -1,7 +1,7 @@ # Check https://github.com/fluxcd/flux2/blob/main/.github/runners/prereq.sh if # you're updating kustomize versions. KUSTOMIZE := ./bin/kustomize -KUSTOMIZE_VERSION ?= v4.5.7 +KUSTOMIZE_VERSION ?= v5.0.3 HELM := ./bin/helm