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

Artifactory StatefulSet pod annoations toYaml #1828

Closed
kasey-weirich opened this issue Oct 11, 2023 · 1 comment · Fixed by #1839
Closed

Artifactory StatefulSet pod annoations toYaml #1828

kasey-weirich opened this issue Oct 11, 2023 · 1 comment · Fixed by #1839
Labels
enhancement New feature or request

Comments

@kasey-weirich
Copy link

FEATURE REQUEST:
Which chart: Artifactory
Which product license: Enterprise/Pro
JFrog support reference: Working with Sudhindra Rao

What happened: Cannot use yaml-based annotations with elements such as multi-line when passing from values file. The current statefulset template uses a range of k:v's to pull in pod annotations from the values file. StatefulSet annotations use the toYaml function though.

Range (currently being used)

This results in only k:v pairs to be used within annotations, meaning you cannot use other yaml functions (lists, multiline)

      annotations:
      ...
      {{- end }}
      {{- range $key, $value := .Values.artifactory.annotations }}
        {{ $key }}: {{ tpl $value $ | quote }}
      {{- end }}

What you expected to happen: Ideally, we would allow yaml here, using the toYaml function.

toYaml (proposed change)

Would allow other yaml formats to be used within annotations. Note: annotations for the statefulSet itself already use the toYaml function (here)

      annotations:
      {{- with .Values.artifactory.annotations }}
{{ toYaml . | indent 8 }}
      {{- end }}

How to reproduce it: Add annotations under artifactory.annoations using multi-line yaml (or a list of values), the template will return an error when attempting to parse due to the range function being used.

Additional info

We would like to get the Vault injector working with Artifactory (Hashicorp docs)

Here is an example annotation snippet (note that there is additional Go templating within the annotation that must be used):

spec:
  template:
    metadata:
      annotations:
        vault.hashicorp.com/agent-inject: "true"
        vault.hashicorp.com/agent-inject-status: "update"
        vault.hashicorp.com/agent-inject-secret-db-creds: "database/creds/db-app"
        vault.hashicorp.com/agent-inject-template-db-creds: |
          {{- with secret "database/creds/db-app" -}}
          postgres://{{ .Data.username }}:{{ .Data.password }}@postgres:5432/appdb?sslmode=disable
          {{- end }}
@chukka chukka added the enhancement New feature or request label Oct 13, 2023
@shahiinn
Copy link
Collaborator

@kasey-weirich : Thank you for raising this feature request along with a proposed solution.
We have opened a ticket on our end for this implementation and testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants