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

fix: removed additional YAML document header when rendering CRDs #12960

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shruti2522
Copy link

@shruti2522 shruti2522 commented Apr 17, 2024

What this PR does / why we need it:
Fixes #12953. I have modified the way CRD file data is rendered so that no additional headers are generated in the stdout.

Output before:

shruti@fedora:~/cncf/helm$ bin/helm template --include-crds cmd/helm/testdata/testcharts/subchart/ | head
---
# Source: subchart/crds/crdA.yaml
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: testcrds.testcrdgroups.example.com
spec:
  group: testcrdgroups.example.com
  version: v1alpha1

Output after:

shruti@fedora:~/cncf/helm$ bin/helm template --include-crds cmd/helm/testdata/testcharts/subchart/ | head
---
# Source: subchart/crds/crdA.yaml

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: testcrds.testcrdgroups.example.com
spec:
  group: testcrdgroups.example.com
  version: v1alpha1

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 17, 2024
@gjenkins8
Copy link
Contributor

gjenkins8 commented May 10, 2024

Thanks for the PR!

Can we include a test please (to prevent regression of this behavior in the future). Otherwise I agree with the approch in this PR -- the existing separator in the file needs to be removed if it exists, as Helm is adding its own (and if Helm didn't add it's own, yaml files without seperators would be rendered to stdout without yaml seperators, which also breaks other tools)

For additional context, I'm sure there was an issue/PR recently which fixed that last point. But I don't immediately see it in the git history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional YAML document header when rendering CRDs to stdout
2 participants