Skip to content

Commit 55e1739

Browse files
authored
Allow app.kubernetes.io/component to be overriden (#3198) (#3424)
1 parent 66e4132 commit 55e1739

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

helm-chart/kuberay-operator/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ Expand the name of the chart.
66
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
77
{{- end -}}
88

9+
{{/*
10+
Allow the component label to be overridden, otherwise provide a default value.
11+
*/}}
12+
{{- define "kuberay-operator.component" -}}
13+
{{- default .Chart.Name .Values.componentOverride | trunc 63 | trimSuffix "-" -}}
14+
{{- end -}}
15+
916
{{/*
1017
Create a default fully qualified app name.
1118
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).

helm-chart/kuberay-operator/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
labels:
2121
app.kubernetes.io/name: {{ include "kuberay-operator.name" . }}
2222
app.kubernetes.io/instance: {{ .Release.Name }}
23-
app.kubernetes.io/component: kuberay-operator
23+
app.kubernetes.io/component: {{ include "kuberay-operator.component" . }}
2424
{{- if .Values.labels }}
2525
{{- toYaml .Values.labels | nindent 8 }}
2626
{{- end }}

helm-chart/kuberay-operator/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ image:
99

1010
nameOverride: "kuberay-operator"
1111
fullnameOverride: "kuberay-operator"
12+
componentOverride: "kuberay-operator"
1213

1314
serviceAccount:
1415
# Specifies whether a service account should be created

0 commit comments

Comments
 (0)