From 60f4559c1033c038fcb487252d937f142e8aa233 Mon Sep 17 00:00:00 2001 From: Juan Montufar Date: Fri, 1 May 2026 15:14:05 -0600 Subject: [PATCH] feat: include the option so deployment secret can be created by external source --- charts/cortex-agent/templates/daemonset.yaml | 6 +++--- charts/cortex-agent/templates/deployment-secret.yaml | 2 +- charts/cortex-agent/values.yaml | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/charts/cortex-agent/templates/daemonset.yaml b/charts/cortex-agent/templates/daemonset.yaml index 04beeb5..c8bbdcd 100644 --- a/charts/cortex-agent/templates/daemonset.yaml +++ b/charts/cortex-agent/templates/daemonset.yaml @@ -143,7 +143,7 @@ spec: mountPath: /etc/traps {{- end }} - {{- if .Values.deploymentSecret.create }} + {{- if or .Values.deploymentSecret.create .Values.deploymentSecret.name }} - name: deployment-secrets mountPath: /opt/traps/config/deployment readOnly: true @@ -205,10 +205,10 @@ spec: type: DirectoryOrCreate {{- end }} - {{- if .Values.deploymentSecret.create }} + {{- if or .Values.deploymentSecret.create .Values.deploymentSecret.name }} - name: deployment-secrets secret: - secretName: {{ include "cortex-xdr.deploymentSecretName" . }} + secretName: {{ .Values.deploymentSecret.name | default (include "cortex-xdr.deploymentSecretName" .) }} {{- end }} {{- if (include "cortex-xdr.dockerPullSecretName" .) }} diff --git a/charts/cortex-agent/templates/deployment-secret.yaml b/charts/cortex-agent/templates/deployment-secret.yaml index 237e6d9..f375de0 100644 --- a/charts/cortex-agent/templates/deployment-secret.yaml +++ b/charts/cortex-agent/templates/deployment-secret.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ include "cortex-xdr.deploymentSecretName" . }} + name: {{ .Values.deploymentSecret.name | default (include "cortex-xdr.deploymentSecretName" .) }} namespace: {{ .Values.namespace.name }} type: Opaque stringData: diff --git a/charts/cortex-agent/values.yaml b/charts/cortex-agent/values.yaml index da1448e..c0f2aee 100644 --- a/charts/cortex-agent/values.yaml +++ b/charts/cortex-agent/values.yaml @@ -14,6 +14,9 @@ deploymentSecret: # Set to "false" to inject distributionId externally, e.g. Vault-agent-injector create: true + # In case you want to create your own deployment secret, enter its name here + name: "" + serviceAccount: # create/don't create service account create: true