From 1bb5b87d4acd609d2b7924437e81e703bc26c425 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 5 Sep 2023 19:37:56 -0400 Subject: [PATCH] Conditionally add annotations if defined --- .../helm/node-feature-discovery/templates/master.yaml | 8 ++++++-- .../helm/node-feature-discovery/templates/nfd-gc.yaml | 4 +++- .../node-feature-discovery/templates/topologyupdater.yaml | 4 +++- .../helm/node-feature-discovery/templates/worker.yaml | 8 ++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/deployment/helm/node-feature-discovery/templates/master.yaml b/deployment/helm/node-feature-discovery/templates/master.yaml index d129a4b64..c2a4ff534 100644 --- a/deployment/helm/node-feature-discovery/templates/master.yaml +++ b/deployment/helm/node-feature-discovery/templates/master.yaml @@ -6,8 +6,10 @@ metadata: labels: {{- include "node-feature-discovery.labels" . | nindent 4 }} role: master + {{- with .Values.master.deploymentAnnotations }} annotations: - {{- toYaml .Values.master.deploymentAnnotations | nindent 4 }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.master.replicaCount }} selector: @@ -19,8 +21,10 @@ spec: labels: {{- include "node-feature-discovery.selectorLabels" . | nindent 8 }} role: master + {{- with .Values.master.annotations }} annotations: - {{- toYaml .Values.master.annotations | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/deployment/helm/node-feature-discovery/templates/nfd-gc.yaml b/deployment/helm/node-feature-discovery/templates/nfd-gc.yaml index ff0859ea1..69d99c2f6 100644 --- a/deployment/helm/node-feature-discovery/templates/nfd-gc.yaml +++ b/deployment/helm/node-feature-discovery/templates/nfd-gc.yaml @@ -18,8 +18,10 @@ spec: labels: {{- include "node-feature-discovery.selectorLabels" . | nindent 8 }} role: gc + {{- with .Values.gc.annotations }} annotations: - {{- toYaml .Values.gc.annotations | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ .Values.gc.serviceAccountName | default "nfd-gc" }} dnsPolicy: ClusterFirstWithHostNet diff --git a/deployment/helm/node-feature-discovery/templates/topologyupdater.yaml b/deployment/helm/node-feature-discovery/templates/topologyupdater.yaml index 2e5d152a8..a580756ef 100644 --- a/deployment/helm/node-feature-discovery/templates/topologyupdater.yaml +++ b/deployment/helm/node-feature-discovery/templates/topologyupdater.yaml @@ -17,8 +17,10 @@ spec: labels: {{- include "node-feature-discovery.selectorLabels" . | nindent 8 }} role: topology-updater + {{- with .Values.topologyUpdater.annotations }} annotations: - {{- toYaml .Values.topologyUpdater.annotations | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ include "node-feature-discovery.topologyUpdater.serviceAccountName" . }} dnsPolicy: ClusterFirstWithHostNet diff --git a/deployment/helm/node-feature-discovery/templates/worker.yaml b/deployment/helm/node-feature-discovery/templates/worker.yaml index 35eb0ec2a..b05ecb2f9 100644 --- a/deployment/helm/node-feature-discovery/templates/worker.yaml +++ b/deployment/helm/node-feature-discovery/templates/worker.yaml @@ -6,8 +6,10 @@ metadata: labels: {{- include "node-feature-discovery.labels" . | nindent 4 }} role: worker + {{- with .Values.worker.daemonsetAnnotations }} annotations: - {{- toYaml .Values.worker.daemonsetAnnotations | nindent 4 }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: @@ -18,8 +20,10 @@ spec: labels: {{- include "node-feature-discovery.selectorLabels" . | nindent 8 }} role: worker + {{- with .Values.worker.annotations }} annotations: - {{- toYaml .Values.worker.annotations | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: dnsPolicy: ClusterFirstWithHostNet {{- with .Values.imagePullSecrets }}