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

Feature: Cli-flags for controlling the dumping behavior #861

Merged
merged 12 commits into from
Oct 7, 2022

Conversation

MatteoVoges
Copy link
Contributor

@MatteoVoges MatteoVoges commented Oct 4, 2022

Fixed Issues

Added two new CLI-flags:

  1. --multiline-string-style [STYLE]
  • Set representation of multiline string to given style (default: ")
  • Available options:
    • literal: Using | as representation (turns every newline within the string into a literal newline)
    • folded: Using > as representation (removes single newlines within the string)
    • double-quotes: Using " as representation (dumps newlines as \n-character in one string)
    • Find out more about yaml-strings here
  1. --dump-null-as-empty
  • Set representation of none-type-entries to (default: null)

The default behavior of the PrettyDumper does not change.

@ramaro
Copy link
Member

ramaro commented Oct 7, 2022

LGTM! Thanks for this, merging.

@ramaro ramaro merged commit 257f539 into kapicorp:master Oct 7, 2022
@Moep90 Moep90 deleted the cli-flags branch October 11, 2022 08:00
simu added a commit to projectsyn/commodore that referenced this pull request Jan 27, 2023
The field got introduced in kapicorp/kapitan#861
and is read by Kapitan's customized PyYAML representer function for
strings.

We currently just set the field to `""`, but we could consider changing
this to use a nicer multi-line string format for Commodore's output in
the future.
simu added a commit to projectsyn/commodore that referenced this pull request Jan 27, 2023
…` to mock Kapitan argument cache

The fields got introduced in
kapicorp/kapitan#861 and are read by Kapitan's
customized PyYAML representer functions for strings and None values
respectively.

We currently just set the fields to their defaults of `""` and `False`,
but we could consider changing them to use a nicer multi-line string
format for Commodore's output in the future, and to emit `None` entries
in YAML streams as an empty string instead of `null` which would fix
intermittent issues with ArgoCD choking on Helm template outputs, if
`null` documents aren't removed from the output.
simu added a commit to projectsyn/commodore that referenced this pull request Jan 27, 2023
Fields `yaml_multiline_string_style` and `yaml_dump_null_as_empty` got
introduced in kapicorp/kapitan#861 and are read
by Kapitan's customized PyYAML representer functions for strings and
None values respectively.

We currently just set the fields to their defaults of `"double-quotes"`
and `False`, but we could consider changing them to use a nicer
multi-line string format for Commodore's output in the future, and to
emit `None` entries in YAML streams as an empty string instead of `null`
which would fix intermittent issues with ArgoCD choking on Helm template
outputs, if `null` documents aren't removed from the output.
simu added a commit to projectsyn/commodore that referenced this pull request Mar 1, 2023
Fields `yaml_multiline_string_style` and `yaml_dump_null_as_empty` got
introduced in kapicorp/kapitan#861 and are read
by Kapitan's customized PyYAML representer functions for strings and
None values respectively.

We currently just set the fields to their defaults of `"double-quotes"`
and `False`, but we could consider changing them to use a nicer
multi-line string format for Commodore's output in the future, and to
emit `None` entries in YAML streams as an empty string instead of `null`
which would fix intermittent issues with ArgoCD choking on Helm template
outputs, if `null` documents aren't removed from the output.
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.

2 participants