-
Notifications
You must be signed in to change notification settings - Fork 1
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
Multiline strings generate invalid output when whitespace prefixed data #81
Comments
Interestingly, using eg; apiVersion: v1
kind: ConfigMap
metadata:
name: my-example-with-old-ruamel
data:
example.conf: |2
configuration text here becomes ...
example.conf: |
configuration text here which is wrong too aparently. |
sorry for the horrible latency. I had to publish a new version of yamkix that now requires ruamel.yaml>=0.17.27 (thanks for the detailed report) |
(to be honest, I'll have to dig into the subject of whitespace prefixed data first, I've never heard of this feature before 😺 ) |
checked with the updated yamkix version (and ruamel.yaml==0.17.32) Got ---
apiVersion: v1
data:
no_indent_hint: |
some content here
no_indent_hint_with_whitespace: |2
some content here
kind: ConfigMap
metadata:
name: example-no-indicators
---
apiVersion: v1
data:
indent_2: |
some content here
indent_2_with_whitespace: |2
some content here
kind: ConfigMap
metadata:
name: example-with-indicators
so indicators have the good value, but always output if one of the document has them. |
to be sure to understand the target:
or are we OK if the indicators are explicitely set in the output as long as they are like the ones in the inputs? (that seems fine with latest ruamel.yaml, no?) ping @warmfusion |
A new version of kubesplit (0.3.3) has been published, nothing changed in the code, only the requirements that will make you use an updated ruamel.yaml version |
Multiline yaml entries with whitespace prefixes generate invalid indentation indicators on dump.
Metadata
Description
When splitting configuration files that present with existing multiline data blocks with indentation indicators, the generated split versions have the wrong indicators set.
What I Did
Given two configmaps in a yaml file named
input.yaml
When processed through kubesplit
❯ kubesplit -i input.yaml -o example
, the generated files for the indicators'(Shown 'merged' for convenience)
Observe how the entries with whitespace prefixed in their data blocks are now indicated with
|4
, even if previously a value of None or 2 was given; this is incorrect, and can be observed with yamllint test;Additional
When using
--no-dash-inwards
argument, the entries are valid, which I belive hints that the problem lies in the yamkix function here;https://github.com/looztra/yamkix/blob/main/src/yamkix/yamkix.py#L62-L69
Specifically, the 'transform' operationl named strip_leading_double_space
The text was updated successfully, but these errors were encountered: