kustomize-controller icon indicating copy to clipboard operation
kustomize-controller copied to clipboard

Kustomization resources are silently dropped if there is an extra space after `---`

Open alex-berger opened this issue 3 years ago • 2 comments

Today I upgraded from FluxCD version v0.13.4 to version v0.15.3 and suddenly some of our HelmRepository created (and owned) by a Kustomization disappeared despite them still being part of that Kustomization. After some analysis I figured out that actually all resources which had extra spaces (' ') after the YAML --- sequences where silently dropped without any warning or error in the logs. In the following example the linkerd2-edge was silently dropped as it contained an extra space in --- and linkerd-stable was not dropped (as it contains no extra space after ---).

--- 
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
  name: linkerd2-edge
  namespace: flux-system
spec:
  interval: 10m
  url: https://helm.linkerd.io/edge
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
  name: linkerd2-stable
  namespace: flux-system
spec:
  interval: 10m
  url: https://helm.linkerd.io/edge-stable

I assume this is some kind of bug related to YAML parsing. Maybe this is another breaking change resulting from switching to Kustomize V4 (https://github.com/fluxcd/flux2/issues/1522) or go-yaml.

alex-berger avatar Jun 23 '21 21:06 alex-berger

Yes, this is definitely related to fluxcd/flux2#1522 – thanks for the report

kingdonb avatar Jul 08 '21 15:07 kingdonb

I'm going to look through sig-cli/kustomize for any open issues related to this report and try to link them back, so we can know when this is unblocked.

kingdonb avatar Jul 22 '21 17:07 kingdonb