truecharts / public

Community Helm Chart Repository
https://truecharts.org
GNU Affero General Public License v3.0
1.14k stars 617 forks source link

Duplicate labels in MutatingWebhookConfiguration and ValidatingWebhookConfiguration #11938

Closed maurice-arends closed 3 months ago

maurice-arends commented 1 year ago

App Name

prometheus-operator

SCALE Version

Not using SCALE

App Version

Chart version 1.0.2

Application Events

Helm upgrade failed: error while running post render on files: map[string]interface {}(nil): yaml: unmarshal errors:
line 8: mapping key "app" already defined at line 7

Application Logs

Helm upgrade failed: error while running post render on files: map[string]interface {}(nil): yaml: unmarshal errors:
line 8: mapping key "app" already defined at line 7

Application Configuration

---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: truecharts
  namespace: myappnamespace
spec:
  interval: 24h
  url: https://charts.truecharts.org
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: prometheus-operator
  namespace: myappnamespace
spec:
  chart:
    spec:
      chart: prometheus-operator
      version: "*"
      sourceRef:
        kind: HelmRepository
        name: truecharts
        namespace: myappnamespace
      interval: 12h
  install:
    crds: Create
  interval: 30m
  releaseName: prometheus-operator
  targetNamespace: myappnamespace
  upgrade:
    crds: CreateReplace

Describe the bug

I'm using flux (https://fluxcd.io/) to install the helm chart in my cluster using the manifest shown in the Application Configuration section. This throws an error because the app label is added twice in the template files linked below:

https://github.com/truecharts/charts/blob/master/charts/operators/prometheus-operator/templates/_mutatingwebhookconfiguration.tpl

https://github.com/truecharts/charts/blob/master/charts/operators/prometheus-operator/templates/_validatingwebhookconfiguration.tpl

In both files, the duplcate label is present on line 14, I think this can be resolved by merging the app label with the $labels dictionary instead.

To Reproduce

  1. install flux as described on their get started page (https://fluxcd.io/flux/get-started/)
  2. Add a new file to your flux repository with the contents as shown in the Application Configuration section
  3. push your changes and monitor the flux output

Expected Behavior

Flux succeeds in installing the HelmRelease of the prometheus-operator

Screenshots

Not applicable

Additional Context

Currently I'm manually installing the prometheus-operator helm chart as part of a guacamole installation, along with the dependency on cloudnative-pg, both the latter applications I can install with flux without issues. Would love to see a fix for this chart, so I can do the entire install through flux.

I've read and agree with the following

stavros-k commented 1 year ago

Probably this is good chance to migrate to the templated webhooks from common @Ornias1993

PrivatePuffin commented 9 months ago

Likely we will port prometheus operator to directly consume upstream instead

truecharts-admin commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.

truecharts-admin commented 3 months ago

This issue has been automatically closed due to inactivity. Please re-open if this still requires investigation.