Skip to content

fix: remove duplicated labels - #30

Open
kkrypt0nn wants to merge 1 commit into
semaphoreui:mainfrom
kkrypt0nn:fix/duplicate-labels
Open

fix: remove duplicated labels#30
kkrypt0nn wants to merge 1 commit into
semaphoreui:mainfrom
kkrypt0nn:fix/duplicate-labels

Conversation

@kkrypt0nn

@kkrypt0nn kkrypt0nn commented May 28, 2026

Copy link
Copy Markdown

On some resources the labels were set twice. The labels set in the values are already in the helper method as last:

{{/*
Create basic labels
*/}}
{{- define "semaphoreui.labels" -}}
helm.sh/chart: "{{ include "semaphoreui.chart" . }}"
app.kubernetes.io/name: "{{ include "semaphoreui.name" . }}"
app.kubernetes.io/instance: "{{ .Release.Name }}"
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
{{- with .Values.labels }}
{{ toYaml . }}
{{- end }}
{{- end -}}

As example, when rendering the chart with the following command:

helm template test semaphore-16.2.2.tgz --set labels.hello=world

We currently get a double hello: world label:

# Source: semaphore/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap

metadata:
  name: test-semaphore-config
  namespace: default
  labels:
    helm.sh/chart: "semaphore-16.2.2"
    app.kubernetes.io/name: "semaphore"
    app.kubernetes.io/instance: "test"
    app.kubernetes.io/version: "2.18.3"
    app.kubernetes.io/managed-by: "Helm"
    hello: world
    hello: world

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.

1 participant