-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add support for auto line indentation of multi line config to ConfigRenderer #445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple of small things.
Thank you for the review. I will fix the findings. In addition, I will add the new partial syntax to the user documentation. |
Co-authored-by: Kaloyan <[email protected]>
Is this a standalone PR, or is it part of the current ticket #393? I was assuming the later, but if we want it as a standalone one, we should either add a description to it, or an create an issue and link it. (I would go for the description.) |
The issue was detected within #393 but the fix is independent and a general configuration rendering issue. I will add a description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, small findings documented.
There are also some value duplications in the new test for the escaped string, but it's ok for a test.
Co-authored-by: Kaloyan <[email protected]>
Co-authored-by: Kaloyan <[email protected]>
I will make constants but not global, because it is only needed inside the escape test. |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
The PR fixes expansion of multi-line configuration items with no indentation level consideration when using the default handlebars template syntax.
Scenario:
A user defines a multi-line sharable configuration item in the state and uses this configuration item in a workload field where line indentation must be considered in the current context during expansion of templates. The indentation level shall be considered to ensure validity of indentation-sensitive formats like YAML.
Changes:
indent
in the handlebars template engine object (when rendering partials the line indentation will be automatically considered according to the current render context)\"
to"
, ...The added system test shows an example use case with podman kube's ConfigMaps where it is important to keep line indentation while expanding templates in workload configuration.
Definition of Done
The PR shall be merged only if all items mentioned in CONTRIBUTING.md have been followed. In case an item is not applicable as described, please provide a short explanation in the description.