Open rassie opened 1 year ago
@rassie is there a reason you are running cdk8s synth
with the -p
flag in conjunction with setting the yaml output type to YamlOutputType.FILE_PER_RESOURCE
? As you mentioned, running cdk8s synth -p
with the default yaml output type does not cause this problem.
I'm using cdk8s with Argo-CD, where I rely on -p
to output the manifests. However, I do not control every single deployment repository, so it's up to those developers to set the output type correctly and with "per resource" being the default, I would just like to be sure that -p
works correctly with every output type.
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: Bug Report