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: remove trailing dashes for multidoc yaml #1331

Conversation

theurichde
Copy link
Contributor

Fixes #1330 #1296

Description of the change

While introducing multi document support for JSON and YAML, we introduced trailing dashes for YAMLs, which violates the YAML specification. This change will separate JSON and YAML with \n for JSON and --- for YAML, only if there are multiple documents given. It will not append a new line or dashes for the last document

Benefits

YAML specification is met, linters will be happy.

Possible drawbacks

Applicable issues

Additional information

@tewfik-ghariani
Copy link
Contributor

Or maybe you could simply add the --- at the beginning of every object for YAML format ^^

@theurichde
Copy link
Contributor Author

Or maybe you could simply add the --- at the beginning of every object for YAML format ^^

Yeah, sure. That would be the more pragmatic way. I thought of having it clean from the beginning, with only a separator in between. But having just the dashes upfront every document, would be also fine for me.

What do you think @alemorcuq @agarcia-oss @alvneiayu ?

@lindhe
Copy link
Contributor

lindhe commented Sep 27, 2023

Having --- at the beginning of every YAML document is considered good practice by the the third party tool yamllint: https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration

@theurichde
Copy link
Contributor Author

Let's go the pragmatic way. There is also muuuch less code changes involved.

@theurichde
Copy link
Contributor Author

I will close this PR in favor of #1335

@theurichde theurichde closed this Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubeseal appends extra document separator --- when format is YAML
3 participants