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

import-values of subcharts not applied in some cases #115

Closed
rquinio1A opened this issue May 20, 2021 · 2 comments · Fixed by #117
Closed

import-values of subcharts not applied in some cases #115

rquinio1A opened this issue May 20, 2021 · 2 comments · Fixed by #117

Comments

@rquinio1A
Copy link

I'm trying to use helm-unittest 0.2.6 on Windows to test my charts, but I noticed something weird:

  • Everything works fine with the first 2 test cases
  • But when I add a 3rd case (identical to the 2nd case, in the same test suite or a separate one), then import-values is not honored and I get nil errors on some global values.

My Chart.yaml has:

dependencies:
  - name: library-chart
    import-values:
      - child: microservice
        parent: microservice
      - child: global
        parent: global

The difference I see in the vscode debugger is at:
https://github.com/helm/helm/blob/b1e24764325135b364a7f81fb0aab683d190c546/pkg/chartutil/dependencies.go#L234

  • for the first 2 test cases , r.ImportValues is of type <map[string]interface {}>
    type-ok

  • for the 3rd test case, r.ImportValues is of type <map[string]string>, so it doesn't match any of the switch cases, and values are not imported !
    type-ko

I'm a newbie at Golang and not sure what the root cause may be...
But it's strange that chart object instances would be constructed differently, given it's the same Chart.yaml and test case config.

@rquinio1A
Copy link
Author

After some more investigations, I have found a potential fix.

@quintush
Copy link
Owner

Hello @rquinio1A,

Thanks for the fix.
I have merged the code and additionally i will add a testproject to verify the behaviour.

Greetings,
@quintush

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

Successfully merging a pull request may close this issue.

2 participants