-
Notifications
You must be signed in to change notification settings - Fork 291
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
cdk8s synth -p
fails to insert necessary document start markers
#2155
Comments
@rassie is there a reason you are running |
I'm using cdk8s with Argo-CD, where I rely on |
When output to STDOUT is requested, each manifest in an app is rendered separately and dumped to standard output. In case an app contains more than one chart, a document separator will be missing between adjacent charts, since there is no YAML document separator either at the beginning or at the end of an individual output. The last resource of the preceding chart and the first resource of the following chart will be merged into a random mess. By adding a YAML document separator after each manifest unconditionally, this can be cleanly avoided. Fixes: #943
When output to STDOUT is requested, each manifest in an app is rendered separately and dumped to standard output. In case an app contains more than one chart, a document separator will be missing between adjacent charts, since there is no YAML document separator either at the beginning or at the end of an individual output. The last resource of the preceding chart and the first resource of the following chart will be merged into a random mess. By adding a YAML document separator after each manifest unconditionally, this can be cleanly avoided. Fixes: #943 Signed-off-by: Nikolai Prokoschenko <[email protected]>
When output to STDOUT is requested, each manifest in an app is rendered separately and dumped to standard output. In case an app contains more than one chart, a document separator will be missing between adjacent charts, since there is no YAML document separator either at the beginning or at the end of an individual output. The last resource of the preceding chart and the first resource of the following chart will be merged into a random mess. By adding a YAML document separator after each manifest unconditionally, this can be cleanly avoided. Fixes: #943 Signed-off-by: Nikolai Prokoschenko <[email protected]>
This issue has not received any attention in 1 year and will be closed soon. If you want to keep it open, please leave a comment below @mentioning a maintainer. |
@iliapolo should be still valid. |
Description of the bug:
If
cdk8s synth -p
is used with any otheryamlOutputType
setting on the app thanYamlOutputType.FILE_PER_APP
, the YAML being output is missing some document start markers.Reproduction Steps:
cdk8s
projectconst app = new App();
toconst app = new App({ yamlOutputType: YamlOutputType.FILE_PER_RESOURCE });
inmain.ts
npm run compile && cdk8s synth -p
As you can see, this output is missing the YAML document start marker
---
before the second resource.Other:
The reason is obviously that
synth -p
is not outputting documents one by one, but instead it runssynth
into a temporary directory and then concatenated the files generated. The document start marker is missing at the exact spot where two files come together. For obvious reasons, this is not a problem withYamlOutputType.FILE_PER_APP
.A simple solution could be adding a document start marker to each file or each resource by default (which is recommended anyway, e.g. in yamllint).
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: