Flux upgrade leads to mutiple failed helmreleases
I tried to upgrade flux from 0.14.2 to 0.16.1 in 1978d270 (included in !458 (merged)), but hit a helm-controller error where Helm Chart installation failed due to post renderer yaml unmarshal error.
I.e. the local-path-provisioner
helmrlease failed with:
│ Normal info 4m36s helm-controller Helm install has started │
│ Normal error 4m36s helm-controller Helm install failed: error while running post render on files: map[string]interface {}(nil): yaml: unmarshal errors: │
│ line 15: mapping key "apiVersion" already defined at line 2 │
│ line 16: mapping key "data" already defined at line 14
The problem seems to be that some helm charts produce duplicate keys, which are handled fine by older helm-controller versions but now fail on latest versions.
Affected versions:
❯ flux --version
flux version 0.16.1
❯ flux check
► checking prerequisites
✔ kubectl 1.21.1 >=1.18.0-0
✔ Kubernetes 1.21.2+k3s1 >=1.16.0-0
► checking controllers
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.15.0
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.11.1
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.13.2
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.15.3
✔ all checks passed
Reverting brings back these versions, which doesn't fail:
❯ flux check
► checking prerequisites
✗ flux 0.14.2 <0.16.1 (new version is available, please upgrade)
✔ kubectl 1.21.1 >=1.18.0-0
✔ Kubernetes 1.21.2+k3s1 >=1.16.0-0
► checking controllers
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.12.2
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.14.1
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.10.1
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.13.2
✔ all checks passed