Giter Site home page Giter Site logo

How can i use nesting values ? about helm HOT 4 OPEN

deliverybot avatar deliverybot commented on June 19, 2024
How can i use nesting values ?

from helm.

Comments (4)

winggundamth avatar winggundamth commented on June 19, 2024 1

Have you tried

          values: |
            image.tag: "${{ github.sha }}"

When setting values for helm on the command line you'd use --set image.tag=$GITHUB_SHA, maybe the same applies here too?

I tried it and it is not working. fortunately, I found the way by putting it in JSON format instead of YAML.

          values: |
            {
              "image": {
                "tag": "${{ github.sha }}"
              }
            }

But it will be better if we can it to support YAML nested format.

This is my guest. The root cause of the problem comes from when you using this

          values: |
            image: 
              tag: "${{ github.sha }}"

It will remove space indent on the second line, so content in values.yml will look like this

image: 
tag: "abcdefg"

See my debug value to test this scenario here https://github.com/winggundamth/bookinfo-ratings/runs/2468832416. You will see the following to confirm my assumption that the space indent has been removed

Run deliverybot/helm@v1
  with:
    helm: helm3
    release: bookinfo-dev-ratings
    namespace: student169-bookinfo-dev
    chart: k8s/helm
    value-files: k8s/helm-values/values-bookinfo-dev-ratings.yaml
    values: extraEnv:
    COMMIT_SHA: de44bcca7d9a046fc3a625cbbc1006b949408b68
  
  env:
    ENV_NAME: dev
    KUBECONFIG: /home/runner/work/bookinfo-ratings/bookinfo-ratings/2f4bf7f5-da00-4f07-a59e-d7f69bbeb0a2

from helm.

colinjfw avatar colinjfw commented on June 19, 2024

@polRk what error are you seeing when you try this?

from helm.

riker09 avatar riker09 commented on June 19, 2024

Have you tried

          values: |
            image.tag: "${{ github.sha }}"

When setting values for helm on the command line you'd use --set image.tag=$GITHUB_SHA, maybe the same applies here too?

from helm.

riker09 avatar riker09 commented on June 19, 2024

Ah yes, the infamous multiline strings in YAML. Whenever I have to deal with this I head over to https://yaml-multiline.info/. But it looks like you are right and there is no way of keeping the indentation intact. Your solution is probably the only way to make this work. Thankfully YAML and JSON are compatible since YAML is a superset of JSON. This is explained in detail in this StackOverflow question (and answer).

from helm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.