-
Notifications
You must be signed in to change notification settings - Fork 706
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 initial helm post renderer. #1670
Add initial helm post renderer. #1670
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.
LGTM, I'm curious about how you plug the post-renderer in Helm actions
"bytes" | ||
"io" | ||
|
||
"gopkg.in/yaml.v3" |
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'm curious, is it needed to use v3 or is just to use the latest?
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.
It was just to use the latest. The only difference that's relevant is that v3 has a default tab intent of 4 spaces, as well as a SetIndent()
function. I'll switch to v2 since I'd not realised v3 isn't yet stable/released.
modifiedManifests = bytes.NewBuffer([]byte{}) | ||
encoder := yaml.NewEncoder(modifiedManifests) | ||
defer encoder.Close() | ||
encoder.SetIndent(2) |
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.
isn't this the default?
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.
It is the default for v2 but not v3.
value: env_value | ||
image: example.com/bitnami/nginx:1.16.1-debian-10-r42 | ||
name: container-name | ||
restartPolicy: Never |
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.
mmh, I see it's in alphabetical order, what does it? Is it reliable?
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.
Yes, the output is reliably ordered. I assume the reason is that when the import happens, ordered yaml dicts are imported into explicitly unordered go maps.
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, I'm curious about how you plug the post-renderer in Helm actions
It's just an explicit arg. I'll do it in the next PR (since it has no effect if no secrets are set).
"bytes" | ||
"io" | ||
|
||
"gopkg.in/yaml.v3" |
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.
It was just to use the latest. The only difference that's relevant is that v3 has a default tab intent of 4 spaces, as well as a SetIndent()
function. I'll switch to v2 since I'd not realised v3 isn't yet stable/released.
modifiedManifests = bytes.NewBuffer([]byte{}) | ||
encoder := yaml.NewEncoder(modifiedManifests) | ||
defer encoder.Close() | ||
encoder.SetIndent(2) |
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.
It is the default for v2 but not v3.
value: env_value | ||
image: example.com/bitnami/nginx:1.16.1-debian-10-r42 | ||
name: container-name | ||
restartPolicy: Never |
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.
Yes, the output is reliably ordered. I assume the reason is that when the import happens, ordered yaml dicts are imported into explicitly unordered go maps.
Ref #1617 . Adds an initial helm post-renderer which will be updated in subsequent PRs to add the image pulls secret when relevant.