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: support go templates in config sources #426

Merged
merged 2 commits into from
Oct 25, 2023
Merged

Conversation

luisdavim
Copy link
Contributor

fixes #37

This allows the config sources, like ConfigMaps to be go templates. All the functions from sprig lib are supported,
there's also a k8sLookup function to get values from k8s objects, and you can access environment variables from the template under .Env object.

@vmwclabot
Copy link
Member

@luisdavim, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Copy link
Contributor

@Cryptophobia Cryptophobia left a comment

Choose a reason for hiding this comment

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

Some small changes requested, otherwise looks good.

config-reloader/template/template.go Show resolved Hide resolved
config-reloader/template/template.go Show resolved Hide resolved
config-reloader/template/template.go Show resolved Hide resolved
Copy link
Contributor

@Cryptophobia Cryptophobia left a comment

Choose a reason for hiding this comment

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

lgtm

fixes #37

This allows the config sources, like ConfigMaps to be `go` templates.
All the functions from sprig lib are supported,
there's also a k8sLookup function to get values from k8s objects,
and you can access environment variables from the template under .Env
object.

Signed-off-by: Luis Davim <[email protected]>
@slimm609
Copy link
Contributor

discussed internally to adding a label to the secret to make it opt-in to be allowed to get data from the secret to reduce the risk of reading secrets not intended for KFO usage.

slimm609
slimm609 previously approved these changes Oct 25, 2023
@vmwclabot
Copy link
Member

@luisdavim, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

README.md Outdated Show resolved Hide resolved
@slimm609 slimm609 merged commit 19d9f91 into main Oct 25, 2023
4 checks passed
@slimm609 slimm609 deleted the templated_configs branch October 25, 2023 18:17
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.

Support externalized secrets
4 participants