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

(DOCUMENTATION) HelmRelease: set helm values array using valuesFrom #4571

Open
egorksv opened this issue Jan 28, 2024 Discussed in #3909 · 0 comments
Open

(DOCUMENTATION) HelmRelease: set helm values array using valuesFrom #4571

egorksv opened this issue Jan 28, 2024 Discussed in #3909 · 0 comments

Comments

@egorksv
Copy link

egorksv commented Jan 28, 2024

Please update HelmRelease documentation to define key = '{value1, value2, value3}' ConfigMap syntax.

Discussed in #3909

Originally posted by hoffimar May 23, 2023
I would like to use the values override feature of the helm-controller (https://fluxcd.io/flux/components/helm/helmreleases/#values-overrides) and set an array/list in the helm values of my helm release. But I am not clear about the syntax to use.

In the helmrelease I have this reference to a configmap:

    - kind: ConfigMap
      name: array-test
      optional: true
      targetPath: global.theList
      valuesKey: array-test.yaml

The configmap is defined like this:

apiVersion: v1
data:
  array-test.yaml: |-
    - type: apple
      count: 2
    - type: banana
      count: 3
kind: ConfigMap
metadata:
  name: array-test

Using helm -n default my-release get values I see that the values are updated, but are a string instead of a list.

global:
  theList: |-
    - type: apple
      count: 2
    - type: banana
      count: 3

As I would like to iterate over the list/array with range in the helm chart implementation, is there any way to make the configmap entries available as list directly? Or would I need to use fromYaml (from https://helm.sh/docs/chart_template_guide/function_list/#type-conversion-functions) in the helm chart to convert the string to a list first?

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

No branches or pull requests

1 participant