Skip to content

Commit

Permalink
fix(core): Annotations are not handled correctly (kedacore#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkerkhove authored Jun 23, 2023
1 parent 6e9ca8f commit ba332ac
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ jobs:
spec:
podIdentity:
provider: aws-eks
additionalAnnotations:
sample: "annotation"
service:
additionalAnnotations:
hello: "cloud-native world"
EOF
- name: Install deps
Expand Down
12 changes: 9 additions & 3 deletions keda/templates/manager/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ metadata:
prometheus.io/port: {{ .Values.prometheus.operator.port | quote }}
prometheus.io/path: "/metrics"
{{- end }}
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- range $key, $value := .Values.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- with .Values.additionalAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- with .Values.service.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
Expand Down
12 changes: 9 additions & 3 deletions keda/templates/metrics-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ metadata:
prometheus.io/port: {{ .Values.prometheus.metricServer.port | quote }}
prometheus.io/path: "/metrics"
{{- end }}
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- range $key, $value := .Values.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- with .Values.additionalAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- with .Values.service.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
ports:
Expand Down
4 changes: 2 additions & 2 deletions keda/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ metadata:
{{- if .Values.podIdentity.azureWorkload.enabled }}
azure.workload.identity/use: "true"
{{- end }}
{{- include "keda.labels" . | indent 4 }}
{{- include "keda.labels" . | nindent 4 }}
{{- if or .Values.podIdentity.azureWorkload.enabled .Values.podIdentity.aws.irsa.enabled .Values.serviceAccount.annotations .Values.podIdentity.gcp.enabled }}
annotations:
{{- if .Values.additionalAnnotations }}
{{- toYaml .Values.additionalAnnotations | indent 4 }}
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- end }}
{{- if .Values.podIdentity.azureWorkload.enabled }}
{{- if .Values.podIdentity.azureWorkload.clientId }}
Expand Down
10 changes: 10 additions & 0 deletions keda/templates/webhooks/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ metadata:
prometheus.io/port: {{ .Values.prometheus.webhooks.port | quote }}
prometheus.io/path: "/metrics"
{{- end }}
{{- with .Values.additionalAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- with .Values.service.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.webhooks.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down

0 comments on commit ba332ac

Please sign in to comment.