Skip to content

Commit

Permalink
Add annotations to all Kubernetes resources
Browse files Browse the repository at this point in the history
  • Loading branch information
raminqaf committed Oct 29, 2024
1 parent 3388644 commit 880be5c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions charts/streams-app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ This will be used across resources.

{{/*
Define annotations helper for Deployment.
Includes default annotations and conditionally adds consumerGroup.
Only includes annotations if there is content.
Includes default annotations and conditionally adds consumerGroup if applicable.
*/}}
{{- define "streams-app.deployment-annotations" -}}
{{- include "streams-app.annotations" . }}
{{- if .Values.kafka.applicationId }}
{{- if or .Values.annotations .Values.kafka.applicationId }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}

{{- /* Conditionally add the consumerGroup annotation if needed */ -}}
{{- if and .Values.kafka.applicationId (not .Values.annotations.consumerGroup) }}
consumerGroup: {{ .Values.kafka.applicationId | quote }}
{{- end }}
Expand Down

0 comments on commit 880be5c

Please sign in to comment.