kustomize: HelmChartInflationGenerator does not work when building outside kustomization dir
Describe the bug
In kustomization 3.9.1 it is not possible to use HelmChartInflationGenerator when building outside files’ dir.
Files that can reproduce the issue
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
generators:
- generators.yaml
# generators.yaml
apiVersion: builtin
kind: HelmChartInflationGenerator
metadata:
name: xxx
chartName: ingress-nginx
chartRepoUrl: https://kubernetes.github.io/ingress-nginx
values: myvalues.yaml
# myvalues.yaml
nameOverride: foobar
Expected output
kustomize build should indeed render this chart as it does when invoked in kustomization.yaml’s dir
Actual output
kustomize build kusto
Error: Error: open myvalues.yaml: no such file or directory
: failed to run command helm template /tmp/kustomize-448884726/chart/ingress-nginx --values myvalues.yaml
Kustomize version
3.9.1
Platform
linux
Thank you, regards!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 17 (4 by maintainers)
it does not seems a proper solution to me, in fact
--helptell meso, apart this broken contract, anything that use kustomize as an internal tool (let’s say, argocd), cannot properly use it because workdir is a temporary repo clone whose path we can easily reconstruct by hardcoding it
I don’t think I have to tell you how much this is lame. In fact I’m not doing that, baking a custom argocd image instead with a
wrapper.shthat chdir to the firstbuildargument, it’s just a letdown to adopt a tool with such a sloppy QA and it raises many doubts about the goodness of this adoption choice. But who I am at the end 🤷♂️ 😃Ah, also since a relative path does indeed work when kustomize is invoked in the same dir, your answer is probably incorrect either cases. But thank you anyway…
Will take a look.
it obviously does no satisfy the case where you have a base which generate from helm and then you want to last-mile kustomize in overlays, there’s no way to accomplish that ATM
Another quirk I think could definitely related to this bug: I have a base where I inflate some helm charts, keeping overlays to do last mile modifications:
so
base/kustomization.yamlhas:with all the stuff, and
prod-1/kustomization.yamlonly has:Now if i build
base, everything goes as expected, but if I try to buildprod-1:If I copy values file in
prod-1, then build works, but definitely defeat the design all these shenanigans are intended to support 😃HTH, ciao!