You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently when trying to install Envoy Gateway via Jsonnet I hit an obscure problem using std.prune. The reason I had been trying to use std.prune was to remove empty objects from the Envoy Gateway install.yaml file. This file is created via helm templatehere.
When the install.yaml file is rendered, it ends up with yaml documents that contain only the "Source: " comment before being followed by another document containing the actual manifest. Example:
The original issue I raised with Envoy Gateway is here.
This happens because helm template doesn't take in to account how a manifest begins. If it doesn't start with the --- then it adds it in along with the comment and all is well. However, if it does start with --- then helm template will insert a document that has a comment only and then the manifest will be added after that and because the manifest starts with ---, it is added as a separate document.
My suggestion is that helm template should check for the yaml start document line ---\n prior to the comment addition and remove it if it exists so that the comment will always appear in the same document as the manifest it is rendering.
I'm happy to work on the issue but just want some feedback on my proposed solution.
The text was updated successfully, but these errors were encountered:
My suggestion is that helm template should check for the yaml start document line ---\n prior to the comment addition and remove it if it exists so that the comment will always appear in the same document as the manifest it is rendering.
I'm not sure I follow your suggestion here. Specifically, what do you mean by will always appear in the same document as the manifest? The YAML file in question contains multiple documents which helm renders as expected.
Output of
helm version
: version.BuildInfo{Version:"v3.14.3", GitCommit:"v3.14.3", GitTreeState:"", GoVersion:"go1.21.7"}Output of
kubectl version
: N/ACloud Provider/Platform (AKS, GKE, Minikube etc.): N/A
Context
Recently when trying to install Envoy Gateway via Jsonnet I hit an obscure problem using
std.prune
. The reason I had been trying to usestd.prune
was to remove empty objects from the Envoy Gateway install.yaml file. This file is created viahelm template
here.When the
install.yaml
file is rendered, it ends up with yaml documents that contain only the "Source: " comment before being followed by another document containing the actual manifest. Example:Actual output:
Expected output:
The original issue I raised with Envoy Gateway is here.
This happens because
helm template
doesn't take in to account how a manifest begins. If it doesn't start with the---
then it adds it in along with the comment and all is well. However, if it does start with---
thenhelm template
will insert a document that has a comment only and then the manifest will be added after that and because the manifest starts with---
, it is added as a separate document.The offending line appears to be https://github.com/helm/helm/blob/main/cmd/helm/template.go#L116
My suggestion is that
helm template
should check for the yaml start document line---\n
prior to the comment addition and remove it if it exists so that the comment will always appear in the same document as the manifest it is rendering.I'm happy to work on the issue but just want some feedback on my proposed solution.
The text was updated successfully, but these errors were encountered: