-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Enable configuration of whether quotes are used in generated yaml #6773
Conversation
Thx for looking into this. @baloo42 do you want to provide feedback? |
* @param <T> the type of the object being serialized. | ||
* @return a String containing a JSON representation of the provided object. | ||
*/ | ||
public <T> String asYaml(T object, boolean minQuotes) { |
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.
I think this change looks good, but wanted to bring up that based upon the DumpSettings there's a lot that could be overriden about the generation style.
Min quoting is roughly defaultScalarStyle=ScalarStyle.PLAIN - it's just that we need to still quote keys that look like boolean values to kube. Another possibliity is to create our own "DumpSettings" builder and have that as an argument so that this can be expanded in the future without adding additional signatures to asYaml.
I share the concerns Steven mentioned in his comment: Some kind of @MichaelMorrisEst Can you also integrate this into the CLI? |
a6b67d7
to
fea2df0
Compare
* @param <T> the type of the object being serialized. | ||
* @return a String containing a JSON representation of the provided object. | ||
*/ | ||
public <T> String asYaml(T object, YamlDumpSettingsBuilder yamlDumpSettingsBuilder) { |
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.
This should take the YamlDumpSettings, not the Builder.
Other than that, the changes all look good.
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.
Done
Signed-off-by: MichaelMorris <[email protected]>
Signed-off-by: MichaelMorris <[email protected]>
Signed-off-by: MichaelMorris <[email protected]>
Added builder parameter to asYaml() instead of minQuotes to enable future expansion Added to CLI Signed-off-by: MichaelMorris <[email protected]>
fea2df0
to
0dc00af
Compare
Signed-off-by: MichaelMorris <[email protected]>
0dc00af
to
5085d2d
Compare
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, thanks @MichaelMorrisEst
|
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, thx!
Description
Enables configuration of whether quotes are included in yaml generated by the KubernetesSerialization class and exposes that through the CRD generator MOJO by adding a new paramater named "minimizeQuotes".
Closes #6763
Type of change
test, version modification, documentation, etc.)
Checklist