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"
5 changes: 3 additions & 2 deletions charts/argocd-appset-secret-plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# argocd-appset-secret-plugin

![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.3.0](https://img.shields.io/badge/AppVersion-v0.3.0-informational?style=flat-square)
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.3.0](https://img.shields.io/badge/AppVersion-v0.3.0-informational?style=flat-square)

A Helm chart for adding a K8s Secret Plugin Generator to ApplicationSets

Expand Down Expand Up @@ -30,7 +30,8 @@ A Helm chart for adding a K8s Secret Plugin Generator to ApplicationSets
| podSecurityContext | object | `{}` | securityContext for the pod: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ |
| replicaCount | int | `1` | number of replica pods to create |
| resources | object | `{}` | |
| secretVars.existingSecret | string | `""` | the name of an existing secret to use for the secret keys to provide to applicationSets via the plugin generator |
| secretVars.existingSecret.key | string | `"secret_vars.yaml"` | key in secretVars.existingSecret to use for IN-LINE yaml secret values, this key should be the name of the file you want to create in the argocd-appset-secret-plugin container |
| secretVars.existingSecret.name | string | `""` | 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 release or whatever you specified for fullnameOverride |
| securityContext | object | `{}` | securityContext for the container: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ |
| service.port | int | `80` | service port to expose on the cluster |
| service.targetPort | int | `4355` | service target port on the container |
Expand Down
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
# release or whatever you specified for fullnameOverride
name: ""
# -- key in secretVars.existingSecret to use for IN-LINE yaml secret values, this key should be
# 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