The Wayback Machine - https://web.archive.org/web/20201110184529/https://github.com/kubernetes/ingress-nginx/issues/6363
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid yaml in chart: service monitor additionalLabels not guaranteed to be unique #6363

Open
Morriz opened this issue Oct 22, 2020 · 3 comments
Assignees

Comments

@Morriz
Copy link

@Morriz Morriz commented Oct 22, 2020

NGINX Ingress controller version: v0.34.1

Kubernetes version (use kubectl version): 1.18

Chart version: 1.41.3

What happened:

Generated templates include duplicated yaml keys when giving overrides for labels. These are not accepted by static analysis tools (which are increasinlgy used in user space to detect faulty manifests).

However, these are accepted by helm and kubectl, and probably to allow these unstrict overrides and not have to worry about it. However, this is forcibly allowing invalid yaml to be created and propagated as ok practice, which it is not imo.

Example:

labels:
  dupeKey: bla
  dupeKey: dibla

What you expected to happen:

The chart maintainers do not iterate over override labels provided to skip printing the chart provided defaults, leading to duplicate yaml keys.

How to reproduce it:

in the values set:

  metrics:
    enabled: true
    serviceMonitor:
      enabled: true
      additionalLabels:
        release: thenameofyourprometheusyouwishtosendmetricsto

and deploy the chart

/kind bug

@aledbf
Copy link
Member

@aledbf aledbf commented Oct 24, 2020

Pull requests are welcome

@Morriz
Copy link
Author

@Morriz Morriz commented Oct 24, 2020

I was able to choose other labels and worked around it. Imo this is a big issue in the k8s arena, and I hope it will get more attention in the future.

@kundan2707
Copy link
Contributor

@kundan2707 kundan2707 commented Oct 29, 2020

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.