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

Validator inserts extra newlines between Objects #360

Closed
annasong20 opened this issue Nov 21, 2023 · 0 comments · Fixed by #361
Closed

Validator inserts extra newlines between Objects #360

annasong20 opened this issue Nov 21, 2023 · 0 comments · Fixed by #361
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@annasong20
Copy link
Contributor

annasong20 commented Nov 21, 2023

What happened:

Validator expects empty lines before and after each document separator --- in the expected output manifests that I specify in "*.out.yaml".

#example.out.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: x

---

apiVersion: v1
kind: Namespace
metadata:
  name: y

What you expected to happen:

I expected that I should be able to specify consecutive objects in my "*.out.yaml" file without the extra newlines.

#example.out.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: x
---
apiVersion: v1
kind: Namespace
metadata:
  name: y

How to reproduce it (as minimally and precisely as possible):

You can see that the existing guestbook test with validator

expects newlines before and after each document separator

Anything else we need to know?:

This line

that adds additional newlines, even though yamilzer.Encode already adds a newline after the object, is likely the culprit.

@annasong20 annasong20 added the kind/bug Categorizes issue or PR as related to a bug. label Nov 21, 2023
annasong20 added a commit to annasong20/kubebuilder-declarative-pattern that referenced this issue Nov 21, 2023
Remove extra newlines between objects in test/validator manifest output.
k8s-ci-robot added a commit that referenced this issue Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant