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

--namespace is ignored by "helm template" #10737

Open
jpetazzo opened this issue Mar 8, 2022 · 3 comments
Open

--namespace is ignored by "helm template" #10737

jpetazzo opened this issue Mar 8, 2022 · 3 comments
Labels
bug Categorizes issue or PR as related to a bug. v4.x Issues deferred for v4 discussion

Comments

@jpetazzo
Copy link

jpetazzo commented Mar 8, 2022

What I do:

helm template --repo https://helm.github.io/examples hello-world --namespace hello

What I expect:

The generated YAML has namespace: hello

What I see instead:

The generated YAML doesn't have any namespace information

Current workaround:

helm template --repo https://helm.github.io/examples hello-world \
| kubectl create -f- -o yaml --dry-run=client --namespace hello

Output of helm version:

version.BuildInfo{Version:"v3.8.0", GitCommit:"d14138609b01886f544b2025f5000351c9eb092e", GitTreeState:"clean", GoVersion:"go1.17.6"}

This is kind of related to #9813 (but also not quite :)).

If this is not meant to be supported, perhaps using the --namespace flag with helm template could throw an error and suggest the workaround shown above?

@hickeyma hickeyma added bug Categorizes issue or PR as related to a bug. v4.x Issues deferred for v4 discussion labels Mar 9, 2022
@hickeyma
Copy link
Contributor

hickeyma commented Mar 9, 2022

As @bacongobbler stated in #9813 (comment), "helm template is not expected to interact with a cluster - its only job is to load a chart, render its templates with the provided values, and display the output."

This flag should be removed also but it will have to wait until Helm 4 for backward compatibility.

@bacongobbler
Copy link
Member

bacongobbler commented Mar 9, 2022

The —namespace flag affects the value of {{ .Release.Namespace }}. I think there’s value keeping that flag around.

This seems more related to #3553. I gave an explanation why helm does not inject a namespace into the template here: #3553 (comment)

@jpetazzo
Copy link
Author

Would it be worth it to issue a warning when the --namespace flag is used with helm template or would that also be lots of effort for not much gain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug. v4.x Issues deferred for v4 discussion
Projects
None yet
Development

No branches or pull requests

3 participants