Skip to content

Commit

Permalink
Fix secrets name from external secret
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Sep 4, 2024
1 parent 1d8f87b commit 2bf9c44
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions templates/external-secret-docker-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: {{ include "common.fullname" ( dict "root" $ "service" . ) }}
name: {{ include "common.fullname" ( dict "root" $ "service" . "serviceName" "docker-registry" ) }}
{{- include "common.metadata" ( dict "root" $ "service" . ) | nindent 2 }}
spec:
{{- with .refreshInterval }}
Expand All @@ -15,8 +15,8 @@ spec:
secretStoreRef: {{- toYaml . | nindent 4 }}
{{- end }}
target:
name: {{ include "common.fullname" ( dict "root" $ "service" . "serviceName" "external-secret" ) }}
template:
name: {{ include "common.fullname" ( dict "root" $ "service" . "serviceName" "docker-registry" ) }}
git add template:
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: |-
Expand Down
2 changes: 1 addition & 1 deletion templates/external-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
{{- end }}
target:
{{- if not ( hasKey ( default ( dict ) .target ) "name" ) }}
name: {{ include "common.fullname" ( dict "root" $ "service" $definition "serviceName" "external-secret" ) }}
name: {{ include "common.fullname" ( dict "root" $ "service" $definition "serviceName" $name ) }}
{{- end }}
{{- with $definition.target }}
{{- toYaml . | nindent 4 }}
Expand Down
8 changes: 4 additions & 4 deletions tests/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ spec:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: custom-custom-pod
name: custom-custom-pod-docker-registry
labels:
helm.sh/chart: custom-pod
app.kubernetes.io/version: "1.0"
Expand All @@ -1417,7 +1417,7 @@ metadata:
testAnnotation: annotation value
spec:
target:
name: custom-custom-pod-external-secret
name: custom-custom-pod-docker-registry
template:
type: kubernetes.io/dockerconfigjson
data:
Expand Down Expand Up @@ -1495,7 +1495,7 @@ spec:
kind: SecretStore
name: my-secret-store
target:
name: custom-custom-pod-external-secret
name: custom-custom-pod-app
data:
- secretKey: hostname
remoteRef:
Expand All @@ -1519,7 +1519,7 @@ spec:
kind: SecretStore
name: my-global-secret-store
target:
name: custom-custom-pod-external-secret
name: custom-custom-pod-global
data:
- secretKey: pass
remoteRef:
Expand Down

0 comments on commit 2bf9c44

Please sign in to comment.