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

Multi-document yaml outputs #308

Merged
merged 4 commits into from
Jul 23, 2019
Merged

Conversation

caioaao
Copy link
Contributor

@caioaao caioaao commented Jun 11, 2019

This way we can have a multi-document yaml file (see this for more info).

As an example, consider this jsonnet:

{
  'foo': [
    {'a': 1}, {'a': 2}, {'a': 3}
  ]
}

Previously the output (when type=yaml) would be:

- a: 1
- a: 2
- a: 3

With this change, it's:

a: 1
---
a: 2
---
a: 3

This way we can have a multi-document yaml file (see [this](https://pyyaml.org/wiki/PyYAMLDocumentation#dumping-yaml) for more info)
@caioaao caioaao changed the title Check if obj is a mapping before dumping Multi-document yaml outputs Jun 11, 2019
@uberspot
Copy link
Contributor

Just to validate, this is to generate k8s manifests in one file?
It would be awesome if you could add 1-2 sentences in the readme about this functionality so that users are more aware? :)

@caioaao
Copy link
Contributor Author

caioaao commented Jun 13, 2019

@uberspot Any manifest, really. My use case was for generating a kops manifest. Anyway, I'll add it to the readme 👍 Where do you think is best for me to add it to?

@adrianchifor
Copy link
Member

You can add to Readme anywhere you see fit, we can review later. Can you add a test?

@caioaao
Copy link
Contributor Author

caioaao commented Jul 8, 2019 via email

@uberspot uberspot merged commit c4c9ce8 into kapicorp:master Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants