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

fix(add-on): Allow upgrades removing version labels from selectors #612

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions http-add-on/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@ Create chart name and version as used by the chart label.
{{- end -}}

{{/*
Generate basic labels
Generate match labels
IMPORTANT: Any change of these labels will block
future upgrades
*/}}
{{- define "keda-http-add-on.labels" }}
helm.sh/chart: {{ include "keda-http-add-on.chart" . }}
{{- define "keda-http-add-on.matchLabels" }}
app.kubernetes.io/part-of: {{ .Chart.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Generate basic labels
*/}}
{{- define "keda-http-add-on.labels" }}
{{- include "keda-http-add-on.matchLabels" . }}
app.kubernetes.io/version: {{ .Values.images.tag | default .Chart.AppVersion }}
helm.sh/chart: {{ include "keda-http-add-on.chart" . }}
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion http-add-on/templates/interceptor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
selector:
matchLabels:
app.kubernetes.io/component: interceptor
{{- include "keda-http-add-on.labels" . | indent 6 }}
{{- include "keda-http-add-on.matchLabels" . | indent 6 }}
template:
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion http-add-on/templates/interceptor/service-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ spec:
targetPort: admin
selector:
app.kubernetes.io/component: interceptor
{{- include "keda-http-add-on.labels" . | indent 4 }}
{{- include "keda-http-add-on.matchLabels" . | indent 4 }}
2 changes: 1 addition & 1 deletion http-add-on/templates/interceptor/service-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ spec:
targetPort: proxy
selector:
app.kubernetes.io/component: interceptor
{{- include "keda-http-add-on.labels" . | indent 4 }}
{{- include "keda-http-add-on.matchLabels" . | indent 4 }}
2 changes: 1 addition & 1 deletion http-add-on/templates/operator/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
selector:
matchLabels:
app.kubernetes.io/component: operator
{{- include "keda-http-add-on.labels" . | indent 6 }}
{{- include "keda-http-add-on.matchLabels" . | indent 6 }}
template:
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion http-add-on/templates/operator/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ spec:
targetPort: metrics
selector:
app.kubernetes.io/component: operator
{{- include "keda-http-add-on.labels" . | indent 4 }}
{{- include "keda-http-add-on.matchLabels" . | indent 4 }}
2 changes: 1 addition & 1 deletion http-add-on/templates/scaler/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
selector:
matchLabels:
app.kubernetes.io/component: scaler
{{- include "keda-http-add-on.labels" . | indent 6 }}
{{- include "keda-http-add-on.matchLabels" . | indent 6 }}
template:
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion http-add-on/templates/scaler/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ spec:
targetPort: grpc
selector:
app.kubernetes.io/component: scaler
{{- include "keda-http-add-on.labels" . | indent 4 }}
{{- include "keda-http-add-on.matchLabels" . | indent 4 }}
Loading