Remove duplicate app.kubernetes.io/name label from rendered manifests#216
Merged
Conversation
The label is already emitted by the `generic-device-plugin.labels` helper via `selectorLabels`. Having it set both literally and through the helper produces a duplicate map key in the rendered YAML. Helm tolerates that (last-wins), but strict YAML parsers (Kustomize, Flux v2 postRenderers, kubeconform, ArgoCD with strict parsing) reject the output, blocking GitOps installs that postRender the chart. matchLabels selectors are unchanged — they intentionally rely on the literal value matching what selectorLabels emits.
squat
approved these changes
May 13, 2026
squat
requested changes
May 13, 2026
Owner
squat
left a comment
There was a problem hiding this comment.
Can you bump the chart's patch version too?
Patch bump for the duplicate-label rendering fix.
Contributor
Author
|
Done — bumped |
squat
approved these changes
May 13, 2026
Owner
|
Thanks @inistor |
Contributor
Author
Thank you for the quick response |
auto-merge was automatically disabled
May 13, 2026 14:15
Head branch was pushed to by a user without write access
squat
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The DaemonSet and PodMonitor templates emit
app.kubernetes.io/name: generic-device-plugintwice on the same labels map — once literally, once via{{- include "generic-device-plugin.labels" . | nindent N }}(which transitively includesselectorLabels, which emits the same key). Helm tolerates duplicate map keys (last-wins), but strict YAML parsers — Kustomize, Flux v2's Kustomize-basedpostRenderers, ArgoCD with strict parsing,kubeconform, etc. — reject the rendered output.Reproduction (before this patch)
Rendered excerpt that triggers the failure:
Fix
Drop the three literal
app.kubernetes.io/name: generic-device-pluginlines. Thegeneric-device-plugin.labelshelper already emits the same value viaselectorLabels, so all rendered labels are identical to before — just deduplicated.matchLabelsblocks (DaemonSetspec.selector.matchLabels, PodMonitorspec.selector.matchLabels) intentionally keep the literal — those have to match whatselectorLabelsemits.Verification after this patch
DaemonSet
metadata.labelsafter patch:Context
Found this trying to install the chart via Flux v2 with a Kustomize
postRendererspatch to extend the--devicelist with/dev/kvm(separately tracked in #209 / #206). The duplicate-label bug aborts the Helm install before any resource is applied, even with no postRenderer specified if any other tooling in the GitOps pipeline parses the rendered manifests strictly. We worked around it by shipping a raw DaemonSet manifest, but the chart is otherwise exactly what we want — so this small fix unblocks postRenderer-based usage.Investigation and patch prepared with assistance from Claude (Anthropic's CLI for software engineering).