From 01e5062013d3b104dcb0a17872bc1ccadf710ef7 Mon Sep 17 00:00:00 2001 From: Ilya Kheifets Date: Tue, 10 Dec 2024 09:41:32 +0100 Subject: [PATCH] fix: use generic labels Signed-off-by: Ilya Kheifets --- .../templates/worker/_helpers.tpl | 10 ++++++++++ .../templates/worker/flower/deployment.yaml | 8 +++++--- .../templates/worker/flower/service.yaml | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/charts/splunk-connect-for-snmp/templates/worker/_helpers.tpl b/charts/splunk-connect-for-snmp/templates/worker/_helpers.tpl index 7e3e6647e..04a225b5c 100644 --- a/charts/splunk-connect-for-snmp/templates/worker/_helpers.tpl +++ b/charts/splunk-connect-for-snmp/templates/worker/_helpers.tpl @@ -54,6 +54,11 @@ app.kubernetes.io/name: {{ include "splunk-connect-for-snmp.worker.name" . }}-tr app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{- define "splunk-connect-for-snmp.worker.flower.selectorLabels" -}} +app.kubernetes.io/name: {{ include "splunk-connect-for-snmp.worker.name" . }}-flower +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + {{/* Common labels @@ -78,6 +83,11 @@ Common labels {{ include "splunk-connect-for-snmp.labels" . }} {{- end }} +{{- define "splunk-connect-for-snmp.worker.flower.labels" -}} +{{ include "splunk-connect-for-snmp.worker.flower.selectorLabels" . }} +{{ include "splunk-connect-for-snmp.labels" . }} +{{- end }} + {{- define "environmental-variables" -}} - name: CONFIG_PATH value: /app/config/config.yaml diff --git a/charts/splunk-connect-for-snmp/templates/worker/flower/deployment.yaml b/charts/splunk-connect-for-snmp/templates/worker/flower/deployment.yaml index cd66c3d9d..3c023b2e1 100644 --- a/charts/splunk-connect-for-snmp/templates/worker/flower/deployment.yaml +++ b/charts/splunk-connect-for-snmp/templates/worker/flower/deployment.yaml @@ -2,17 +2,19 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: flower + name: {{ include "splunk-connect-for-snmp.worker.fullname" . }}-flower + labels: + {{- include "splunk-connect-for-snmp.worker.flower.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: - app: flower + {{- include "splunk-connect-for-snmp.worker.flower.selectorLabels" . | nindent 6 }} template: metadata: labels: - app: flower + {{- include "splunk-connect-for-snmp.worker.flower.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/charts/splunk-connect-for-snmp/templates/worker/flower/service.yaml b/charts/splunk-connect-for-snmp/templates/worker/flower/service.yaml index ae92c45f3..af954989c 100644 --- a/charts/splunk-connect-for-snmp/templates/worker/flower/service.yaml +++ b/charts/splunk-connect-for-snmp/templates/worker/flower/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: flower-svc + name: {{ include "splunk-connect-for-snmp.worker.fullname" . }}-flower-svc spec: selector: