Skip to content

import-values in child-parent format doesn't work #10052

Closed

Description

@ilya-lesikov

Hi, Can't get example from here to work:
https://helm.sh/docs/topics/charts/#using-the-child-parent-format

To reproduce:

cat >Chart.yaml <<EOF
apiVersion: v2
name: mychart
version: 0.1.0
dependencies:
- name: subchart1
  version: 0.1.0
  import-values:
  - child: default.data
    parent: myimports
EOF

cat >values.yaml <<EOF
myimports:
  myint: 0
  mybool: false
  mystring: "helm rocks!"
EOF

mkdir -p templates
cat >templates/test.yaml <<EOF
out: | {{ $.Values | toYaml | nindent 2 }}
EOF

mkdir -p charts/subchart1/
cat >charts/subchart1/Chart.yaml <<EOF
apiVersion: v2
name: subchart1
version: 0.1.0
EOF

cat >charts/subchart1/values.yaml <<EOF
default:
  data:
    myint: 999
    mybool: true
EOF

helm template .

Result:

---
# Source: mychart/templates/test.yaml
out: | 
  myimports:
    mybool: false
    myint: 0
    mystring: helm rocks!
  subchart1:
    default:
      data:
        mybool: true
        myint: 999
    global: {}

Expected:

---
# Source: mychart/templates/test.yaml
out: | 
  myimports:
    mybool: true
    myint: 999
    mystring: helm rocks!
  subchart1:
    default:
      data:
        mybool: true
        myint: 999
    global: {}

Output of helm version:

version.BuildInfo{Version:"v3.6.3", GitCommit:"d506314abfb5d21419df8c7e7e68012379db2354", GitTreeState:"clean", GoVersion:"go1.16.5"}

Strange thing is that these two differ:

b = CoalesceTables(cvals, pathToMap(parent, vv.AsMap()))

b = CoalesceTables(b, vm.AsMap())

Can't quite get my head around it. The short form of import-values works differently and looks like it's fine.

Activity

  1. github-actions commented on Nov 22, 2021

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  2. added
    bug
    and removed on Jun 22, 2023
  3. mattfarina commented on Jun 22, 2023

    @mattfarina
    Collaborator

    This is a bug. The documentation says this should work.

  4. added 4 commits that reference this issue on Jun 22, 2023
    f34ee13
    dd570de
    d0c29d7
    0a5148f
  5. added a commit that references this issue on Nov 6, 2023
    5356377
  6. realitycheck commented on Aug 1, 2024

    @realitycheck

    Why is this issue closed as completed?

    The provided example follows the documentation for Helm v3.14.0 and doesn't produce the expected result.

    > helm version
    `version.BuildInfo{Version:"v3.14.3", GitCommit:"f03cc04caaa8f6d7c3e67cf918929150cf6f3f12", GitTreeState:"clean", GoVersion:"go1.21.7"}`
    

    Result:

    > helm template .
    ---
    # Source: mychart/templates/test.yaml
    out: | 
      myimports:
        mybool: false
        myint: 0
        mystring: helm rocks!
      subchart1:
        default:
          data:
            mybool: true
            myint: 999
        global: {}
    

    Isn't this still a valid issue since helm-v3.14.3 contradicts its own documentation?

    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions