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 Aug 15, 2024
1 parent 22613a6 commit 00722c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 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 @@ -16,7 +16,7 @@ spec:
{{- end }}
target:
{{- if not ( hasKey ( default ( dict ) .target ) "name" ) }}
name: {{ include "common.fullname" ( dict "root" $ "service" . "serviceName" "external-secret" ) }}
name: {{ include "common.fullname" ( dict "root" $ "service" . "serviceName" "docker-registry" ) }}
{{- end }}
template:
type: kubernetes.io/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 00722c3

Please sign in to comment.