helm: v3: helm template does not render NOTES.txt
Helm version:
$ h3 version
version.BuildInfo{Version:"v3.0.0-rc.3", GitCommit:"2ed206799b451830c68bff30af2a52879b8b937a", GitTreeState:"clean", GoVersion:"go1.13.4"}
Steps to recreate:
$ h3 create foo
Creating foo
$ h3 template foo -s templates/NOTES.txt --notes
Error: unknown flag: --notes
$ tree foo
foo
├── charts
├── Chart.yaml
├── templates
│ ├── deployment.yaml
│ ├── _helpers.tpl
│ ├── ingress.yaml
│ ├── NOTES.txt
│ ├── serviceaccount.yaml
│ ├── service.yaml
│ └── tests
│ └── test-connection.yaml
└── values.yaml
How feature works in Helm 2.x
$ helm template bar -x templates/NOTES.txt --notes
---
# Source: bar/templates/NOTES.txt
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=bar,app.kubernetes.io/instance=release-name" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 28
- Comments: 46 (11 by maintainers)
Commits related to this issue
- fix: backport #6901 to Helm 2 Signed-off-by: Matt Butcher <matt.butcher@microsoft.com> — committed to technosophos/k8s-helm by technosophos 5 years ago
- fix: backport #6901 to Helm 2 (#7196) Signed-off-by: Matt Butcher <matt.butcher@microsoft.com> — committed to helm/helm by technosophos 5 years ago
- fix: backport #6901 to Helm 2 (#7196) Signed-off-by: Matt Butcher <matt.butcher@microsoft.com> (cherry picked from commit ab797325c6363afae3e238c17a7992a84c9802f4) — committed to helm/helm by technosophos 5 years ago
- Helm: add NOTES.txt Add a NOTES.txt that prints the endpoints that will be usable by the user for interacting with mimir/gem. Currently helm does not support rendering the NOTES for testing. Rage/vo... — committed to grafana/mimir by krajorama 2 years ago
- Helm: add NOTES.txt (#2189) * Helm: add NOTES.txt Add a NOTES.txt that prints the endpoints that will be usable by the user for interacting with mimir/gem. Currently helm does not support rend... — committed to grafana/mimir by krajorama 2 years ago
- Helm: add NOTES.txt (#2189) * Helm: add NOTES.txt Add a NOTES.txt that prints the endpoints that will be usable by the user for interacting with mimir/gem. Currently helm does not support rend... — committed to udmire/mimir by krajorama 2 years ago
Bump. It would be useful to test this in
templatecommand by passing a--notesflag. For CI testig purposes.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.
+1 on this one. We have no way to test the code generated by
NOTES.txtwithout a cluster connected (becauseinstall|upgraderequires a cluster, even if--dry-runand--debugare set)For me this issue is still open
/reopen please
It is a relevant feature, but I think there is a need to help out drive development about it.
Current behavior of
--render-subchart-notesIts relevant to overview the current behavior if we consider changing it. I conclude that
--render-subchart-notesis silently ignored when used in thehelm template, but forhelm installit is functioning correctly and as documented.The documentation says
if set, render subchart notes along with the parent, so practically, the documentation is also currently only valid for thehelm installsituation as thealong with the parentpart isn’t true anyhow for when used withhelm template.Steps to create a dummy chart for debugging
Reproduction of broken
helm template --render-subchart-notes .Nothing is rendered when
--render-subchart-notesis used withhelm template.Output from
helm install --dry-run --render-subchart-notes test .Note that the ordering of these, the ordering seems random.
What UX makes sense?
In https://github.com/helm/helm/issues/6901#issuecomment-553010477 @bacongobbler asked for input on what UX to go for.
My short-term UX suggestion
--render-notesflag forhelm templateandhelm installalongside--render-subchart-notesto toggle if the root chart’s notes should be rendered. Let--render-notesbe false by default forhelm template, but true by default forhelm install, to match current behavior.--render-subchart-notesnote about its mention ofalong with the parent, something that should be controlled byrender-notesnow.helm installwith how notes are to be rendered forhelm template. The current behavior is to render notes after all other templates has been rendered, with the separator lineNOTES:. The notes are rendered one after the other in a random order without additional new-line spacing or titles.My long-term UX suggestion
I think we should go for the short-term suggestion above at first and not go straight to this, as this involves breaking changes etc.
When
helm templateis used, we can see the following separators between templates.Now what?
This is a non-breaking proposal that addresses this issue.
Add
--render-notestohelm [template|install]--render-notesdetermines if top level chart NOTES.txt is rendered.--render-subchart-notesdetermines if subchart NOTES.txt are rendered.--render-notesis by default made false forhelm templateand true forhelm install.If you mean to do so by default, this could break tooling which expects the output of
helm templateto be (multidocument) YAML. Would be safer to render it as comments (prepending#to every line):which seems to be tolerated
The trick proposed to render the
NOTES.txtis not working using helm 3.5.4 with a local helm charts/reopen /cc @mattfarina
As a temporary workaround, you can run the following command :
This will render the NOTES.txt file.
I’m keeping my fingers crossed for 3.0 fix 😃
Can we punt on subcharts and even the
--notesoption and just makerender that file, so you can test or iteratively develop complex substitutions in it without needing a live cluster?
Unfortunately this requires an actual cluster, unlike
helm template.