Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update secretVars.existingSecret parameter to include name and key object #14

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion charts/argocd-appset-secret-plugin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ maintainers:
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

version: 0.4.0
version: 0.5.0

# renovate: image=jessebot/argocd-appset-secret-plugin
appVersion: "v0.3.0"
6 changes: 3 additions & 3 deletions charts/argocd-appset-secret-plugin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ Defining the token and base url values for the configmap
Create the name of the vars secret to use: either from an existing secret
or the fullname of the chart + "-secret-vars"
*/}}
{{- define "argocd-appset-secret-plugin.varSecret" -}}
{{- if not .Values.secretVars.existingSecret }}
{{- define "argocd-appset-secret-plugin.secretName" -}}
{{- if not .Values.secretVars.existingSecret.name }}
{{- printf "%s-secret-vars" (include "argocd-appset-secret-plugin.fullname" .) }}
{{- else }}
{{- .Values.secretVars.existingSecret }}
{{- .Values.secretVars.existingSecret.name }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/argocd-appset-secret-plugin/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ spec:
subPath: "token"
readOnly: true
- name: secret-vars
mountPath: "/var/run/secret-plugin/secret_vars.yaml"
subPath: "secret_vars.yaml"
mountPath: "/var/run/secret-plugin/{{ .Values.secretVars.existingSecret.key }}"
subPath: {{ .Values.secretVars.existingSecret.key }}
readOnly: true
resources:
{{- toYaml .Values.resources | nindent 12 }}
Expand All @@ -54,7 +54,7 @@ spec:
secretName: "{{ include "argocd-appset-secret-plugin.tokenSecret" . }}"
- name: secret-vars
secret:
secretName: "{{ include "argocd-appset-secret-plugin.varSecret" . }}"
secretName: "{{ include "argocd-appset-secret-plugin.secretName" . }}"
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
10 changes: 8 additions & 2 deletions charts/argocd-appset-secret-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ nameOverride: ""
fullnameOverride: ""

secretVars:
# -- the name of an existing secret to use for the secret keys to provide to applicationSets via the plugin generator
existingSecret: ""
existingSecret:
# -- the name of an existing secret to use for the secret keys to provide to ApplicationSets via the plugin generator
# defaults to "%s-secret-vars" where %s is argocd-appset-secret-plugin.fullname which is the name of the
jessebot marked this conversation as resolved.
Show resolved Hide resolved
# release or whatever you specified for fullnameOverride
name: ""
# -- key in secretVars.existingSecret to use for IN-LINE yaml secret values, this key should be
jessebot marked this conversation as resolved.
Show resolved Hide resolved
# the name of the file you want to create in the argocd-appset-secret-plugin container
key: "secret_vars.yaml"

token:
# -- the name of an existing secret to use for the token that argoCD and the plugin will use for communication
Expand Down