mvisonneau / helm-charts

Personal Helm charts repository
Apache License 2.0
65 stars 58 forks source link

gitlab-ci-pipelines-exporter: Allow specifying name of existing `Secret` containing tokens #18

Closed shivjm closed 2 years ago

shivjm commented 3 years ago

I have a Secret containing my GitLab API token and webhook token. I’d like to be able to use that instead of specifying them in plaintext when installing the chart, so I added them as env variables:

          - name: "GCPE_WEBHOOK_SECRET_TOKEN"
            valueFrom:
              secretKeyRef:
                name: gitlab-ci-pipelines-exporter-secret
                value: webhook-token
          - name: "GCPE_GITLAB_TOKEN"
            valueFrom:
              secretKeyRef:
                name: gitlab-ci-pipelines-exporter-secret
                value: gitlab-api-token

Unfortunately, the chart unconditionally expects them to be provided as plaintext parameters:

https://github.com/mvisonneau/helm-charts/blob/095facc02b53480a9aef43939e322050331ba9f9/charts/gitlab-ci-pipelines-exporter/templates/secret.yaml#L14-L18

https://github.com/mvisonneau/helm-charts/blob/095facc02b53480a9aef43939e322050331ba9f9/charts/gitlab-ci-pipelines-exporter/templates/secret.yaml#L24-L30

I’d like to be able to point at my Secret instead.

(Incidentally, I’m trying to get to the point where I can test whether mvisonneau/gitlab-ci-pipelines-exporter#280 is resolved… it’s been a really long road, for many reasons, and I apologize for the silence.)