question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`cdk8s synth --stdout` doesn't produce valid yaml output

See original GitHub issue

Description of the bug:

When running cdk8s synth --stdout the output isn’t valid yaml. This is because the first line output is a file name. This makes it unnecessarily difficult to perform further parsing of the output, such as yaml-loading it to split it up into separate files etc.

I would expect the --stdout flag to produce valid yaml

Reproduction Steps:

run cdk8s synth --stdout

Error Log:

Environment:

  • Framework Version:
  • OS:

Other:


This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mrliptonteacommented, Jan 17, 2022

I’d like to make a suggestion - assuming file names in the output are important and intentional, can they not be preceded with # to make a YAML comment? E.g.:

# /tmp/cdk8s-JnaTCh/app.k8s.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
…

I am a bit surprised this isn’t being addressed or discussed - I’d thought that cdk8s synth | kubectl apply -f - would be something that a lot of people would use, especially those coming from kustomize which only recently updated its embedded version so previously had to use kustomize build | kubectl apply -f -.

0reactions
github-actions[bot]commented, Mar 19, 2022

This issue is now marked as stale because it hasn’t seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the “backlog” label.

Read more comments on GitHub >

github_iconTop Results From Across the Web

synth - cdk8s
The cdk8s synth command is a convenience command which will simply execute the application defined in cdk8s.yaml under app . For example, if...
Read more >
aws-cdk | Yarn - Package Manager
To import an existing resource to a CDK stack, follow the following steps: Run a cdk diff to make sure there are no...
Read more >
API Reference | projen
DockerCompose, Create a docker-compose YAML file. ... Default: true; synth ( boolean ) Should we call project.synth() or instantiate the project (could ...
Read more >
Separate output files of cdk8s synth - python - Stack Overflow
The following code will create one yaml file dist/clusterip.k8s.yaml contains all my defines of deployment and statefulset, is there way to ...
Read more >
Integrating cdk8s with Flux - Max Brenner
So in its simplest form imagine a Git repository with a single YAML file that contains a basic Kubernetes manifest (e.g. Deployment + ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found