Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #71 from ContainerSolutions/fix-helm-operator-name
Browse files Browse the repository at this point in the history
introduce operatorName template helper
  • Loading branch information
riccardomc committed Aug 14, 2019
2 parents 13ca2a0 + 300d1aa commit bb3226d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions deploy/helm/templates/_helpers.tpl
Expand Up @@ -63,3 +63,10 @@ Create watchNamespace: if not specified assume is release namespace
{{ default .Release.Namespace }}
{{- end -}}
{{- end -}}

{{/*
Create operatorName if not specified assume is release name
*/}}
{{- define "externalsecret-operator.operatorName" -}}
{{ default .Release.Name .Values.operatorName }}
{{- end -}}
2 changes: 1 addition & 1 deletion deploy/helm/templates/deployment.yaml
Expand Up @@ -32,7 +32,7 @@ spec:
- name: WATCH_NAMESPACE
value: {{ template "externalsecret-operator.watchNamespace" . }}
- name: OPERATOR_NAME
value: {{ template "externalsecret-operator.fullname" . }}
value: {{ template "externalsecret-operator.operatorName" . }}
- name: OPERATOR_CONFIG
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/templates/tests/test-create-secret.yaml
Expand Up @@ -6,7 +6,7 @@ metadata:
name: {{ .Release.Name }}-test
spec:
Key: example-externalsecret-key
Backend: dummy-example
Backend: {{ template "externalsecret-operator.operatorName" . }}
---
# THEN the corresponding Secret is created and its content is as expected
apiVersion: v1
Expand Down
5 changes: 3 additions & 2 deletions deploy/helm/values.yaml
Expand Up @@ -13,8 +13,9 @@ image:
watchNamespace: ""

# The name for this operator, must be referenced by ExternalSecret resources
# as the Backend field
operatorName: externalsecret-operator
# as the Backend field.
# If not set will default to release name.
operatorName: ""

crds:
# Specifies wether the ExternalSecret CRD should be created
Expand Down

0 comments on commit bb3226d

Please sign in to comment.