Skip to content

Commit

Permalink
refactor(occm): define helper template for podAnnotations
Browse files Browse the repository at this point in the history
  • Loading branch information
roehlc committed Feb 14, 2024
1 parent 6431311 commit b9fe10a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
17 changes: 15 additions & 2 deletions charts/openstack-cloud-controller-manager/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,24 @@ component: controllermanager
{{- define "occm.controllermanager.labels" -}}
{{ include "occm.controllermanager.matchLabels" . }}
{{ include "occm.common.metaLabels" . }}
{{- range $key, $val := .Values.podLabels }}
{{ $key }}: {{ $val }}
{{ if .Values.podLabels }}
{{- toYaml .Values.podLabels }}
{{- end }}
{{- end -}}

{{/*
Common annotations and pod annotations
*/}}
{{- define "occm.controllermanager.annotations" -}}
{{- if .Values.commonAnnotations }}
{{- toYaml .Values.commonAnnotations }}
{{- end }}
{{ if .Values.podAnnotations }}
{{- toYaml .Values.podAnnotations }}
{{- end }}
{{- end -}}


{{/*
Create cloud-config makro.
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ spec:
metadata:
annotations:
checksum/config: {{ include "cloudConfig" . | sha256sum }}
{{- with .Values.commonAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "occm.controllermanager.annotations" . | nindent 8 }}
labels:
{{- include "occm.controllermanager.labels" . | nindent 8 }}
spec:
Expand Down

0 comments on commit b9fe10a

Please sign in to comment.