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

Add initial helm post renderer. #1670

Merged
merged 3 commits into from Apr 16, 2020

Conversation

absoludity
Copy link
Contributor

Ref #1617 . Adds an initial helm post-renderer which will be updated in subsequent PRs to add the image pulls secret when relevant.

Copy link
Contributor

@andresmgot andresmgot left a 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"
Copy link
Contributor

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?

Copy link
Contributor Author

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

@absoludity absoludity left a 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"
Copy link
Contributor Author

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)
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@absoludity absoludity merged commit 3f3f76a into vmware-tanzu:master Apr 16, 2020
@absoludity absoludity deleted the helm-template-deploy branch April 16, 2020 00:09
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.

None yet

2 participants