Skip to content

fix: preserve all labels including invalid ones - #1208

Closed
raffis wants to merge 1 commit into
fluxcd:mainfrom
raffis:fix-preserve-invalid-labels
Closed

raffis wants to merge 1 commit into
fluxcd:mainfrom
raffis:fix-preserve-invalid-labels

Conversation

@raffis

@raffis raffis commented May 21, 2026 •

Copy link
Copy Markdown

@matheuscscp matheuscscp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as in the other PR

@stefanprodan

stefanprodan commented May 21, 2026 •

Copy link
Copy Markdown
Member

This behavior is very intentional, the SSA package is used in all controllers and this change breaks them. For the CLI we could have some validation step set there not in this package.

phoban01 added a commit to phoban01/fluxlint that referenced this pull request Sep 22, 2026
…ring

An unquoted 1.31, true or 0 in metadata.labels. Helm installs are rejected
by the API server. Kustomizations are worse: kustomize-controller adds its
ownership labels by reading the label map, adding two and writing it back
(fluxcd/pkg/ssa SetOwnerLabels). The read fails as a whole on one
non-string value, the error is discarded by apimachinery's GetLabels, and
the object is applied with only Flux's two labels. The Kustomization is
Ready and nothing is logged. Reproduced on a kind cluster: a Namespace lost
its Pod Security enforce label and admitted a privileged pod. Flux treats
this as intended (fluxcd/flux2#4968, fluxcd/pkg#1208).

Checked on every kind, custom resources included. Annotations are left out:
kustomize converts those to strings. The schema check no longer reports
the same label a second time.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants