diff --git a/contrib/charts/dragonfly/ci/passwordsecret-values.tpl.golden.yaml b/contrib/charts/dragonfly/ci/passwordsecret-values.tpl.golden.yaml new file mode 100644 index 000000000..002e282a4 --- /dev/null +++ b/contrib/charts/dragonfly/ci/passwordsecret-values.tpl.golden.yaml @@ -0,0 +1,108 @@ +--- +# Source: dragonfly/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: test-dragonfly + namespace: default + labels: + app.kubernetes.io/name: dragonfly + app.kubernetes.io/instance: test + app.kubernetes.io/version: "v1.25.3" + app.kubernetes.io/managed-by: Helm +--- +# Source: dragonfly/templates/extra-manifests.yaml +apiVersion: v1 +kind: Secret +metadata: + name: dragonfly-password +stringData: + password: foobar +--- +# Source: dragonfly/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: test-dragonfly + namespace: default + labels: + app.kubernetes.io/name: dragonfly + app.kubernetes.io/instance: test + app.kubernetes.io/version: "v1.25.3" + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 6379 + targetPort: dragonfly + protocol: TCP + name: dragonfly + selector: + app.kubernetes.io/name: dragonfly + app.kubernetes.io/instance: test +--- +# Source: dragonfly/templates/deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: test-dragonfly + namespace: default + labels: + app.kubernetes.io/name: dragonfly + app.kubernetes.io/instance: test + app.kubernetes.io/version: "v1.25.3" + app.kubernetes.io/managed-by: Helm +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: dragonfly + app.kubernetes.io/instance: test + template: + metadata: + annotations: + labels: + app.kubernetes.io/name: dragonfly + app.kubernetes.io/instance: test + spec: + serviceAccountName: test-dragonfly + containers: + - name: dragonfly + image: "docker.dragonflydb.io/dragonflydb/dragonfly:v1.25.3" + imagePullPolicy: IfNotPresent + ports: + - name: dragonfly + containerPort: 6379 + protocol: TCP + livenessProbe: + exec: + command: + - /bin/sh + - /usr/local/bin/healthcheck.sh + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + exec: + command: + - /bin/sh + - /usr/local/bin/healthcheck.sh + failureThreshold: 3 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + args: + - "--alsologtostderr" + resources: + limits: {} + requests: {} + + env: + - name: DFLY_requirepass + valueFrom: + secretKeyRef: + name: dragonfly-password + key: password diff --git a/contrib/charts/dragonfly/ci/passwordsecret-values.tpl.yaml b/contrib/charts/dragonfly/ci/passwordsecret-values.tpl.yaml new file mode 100644 index 000000000..26ee73e93 --- /dev/null +++ b/contrib/charts/dragonfly/ci/passwordsecret-values.tpl.yaml @@ -0,0 +1,13 @@ +extraObjects: +- apiVersion: v1 + kind: Secret + metadata: + name: dragonfly-password + stringData: + password: foobar + +passwordFromSecret: + enable: true + existingSecret: + name: '{{ include "dragonfly.name" $ }}-password' + key: password diff --git a/contrib/charts/dragonfly/templates/_pod.tpl b/contrib/charts/dragonfly/templates/_pod.tpl index 2994ec7d1..30bf81848 100644 --- a/contrib/charts/dragonfly/templates/_pod.tpl +++ b/contrib/charts/dragonfly/templates/_pod.tpl @@ -111,7 +111,7 @@ containers: {{- end }} valueFrom: secretKeyRef: - name: {{ .Values.passwordFromSecret.existingSecret.name }} + name: {{ tpl .Values.passwordFromSecret.existingSecret.name $ }} key: {{ .Values.passwordFromSecret.existingSecret.key }} {{- end }} diff --git a/go.work.sum b/go.work.sum index bc790f0c3..49a08eca4 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,2 +1,4 @@ -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=