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

Error when using buildMetadata managedByLabel setting

Open pwatsonSANS opened this issue 7 months ago • 1 comments

V1.1.1

When creating a namespace (although other assets may also fail) with managedByLabel is set on I get the following error on dry run

Namespace/sf-web-sandbox dry-run failed, reason: Invalid: Namespace "sf-web-sandbox" is invalid: metadata.labels: Invalid value: "kustomize-(devel)": a valid label must be an empty string or consist of alphanumeric characters

What seems to be happening is that when kustomize in the controller with this flagis being run the semver it is returning kustomize-(devel) rather than a version, which then makes the output yaml invalid

Link to managedByLabel code

https://github.com/kubernetes-sigs/kustomize/blob/master/api/krusty/kustomizer.go#L101

Link to Provenance code (used to get semver)

https://github.com/kubernetes-sigs/kustomize/blob/master/api/provenance/provenance.go#L18

Previously we were using v0.35.1 and did not encounter this error

pwatsonSANS avatar Nov 09 '23 14:11 pwatsonSANS