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

feat: add --force-yaml-string-quotation forcing string quotation for rendered YAML #731

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

xvzf
Copy link
Contributor

@xvzf xvzf commented Jul 14, 2022

This PR adds the --force-yaml-string-quotation which patches the yaml.Node object and adds a custom formatting option to inject quotes around strings.

Fixes #687

xvzf added 3 commits July 14, 2022 15:31
Signed-off-by: Matthias Riegler <[email protected]>
Signed-off-by: Matthias Riegler <[email protected]>
@xvzf xvzf force-pushed the fix/issue-687-flux-substitution branch from d02b8ea to a1a9ecf Compare July 14, 2022 15:07
@@ -9,9 +9,19 @@ import (
"github.com/Masterminds/sprig/v3"
"github.com/pkg/errors"
"github.com/stretchr/objx"
yaml "gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's going to be a blocker for us 😞. v3 has major formatting differences from v2, and there's no way to configure it (see #607 (comment)). For anyone using GitOps, this upgrade is very troublesome because it means that most Kubernetes resources will be redeployed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, didn't think about this, thought this had been resolved already. Do you consider switching to the fork the kustomize folks are using right now? With the v2 API, we cannot have such functionalities

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can maintain the same indentations as we currently have, and it supports new features such as this, then I think it'd be a good option

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So - the short version of this is that we cannot, I'll check if I can come up with another way, maybe a feature flag like --use-yaml-v3?

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.

Template environment substitution (e.g. from Flux) breaks Kubernetes Secrets
2 participants