Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Add 'dataFromLiteral' to ExternalSecret API #790

Conversation

jwtracy
Copy link

@jwtracy jwtracy commented Jul 9, 2021

I have a use case where I need a Kubernetes secret which contains a file
meant to be mounted to a container. In this file there is sensitive data
so it must be templated using the spec.template.stringData
functionality. Within this file there is also recurring, non-sensitive,
data that would benefit from being templated.

More specifically, I had a dozen references to a GCP project ID which
would need to be hard coded in that many locations.

I tried to supply this within the spec.template.stringData, but
expectedly, that data is not part of the map which renders the template;
only spec.data and spec.dataFrom are merged for that.

It would be possible to use Helm to fill Golang templates within the
lodash template, however, if feels like a bad practice to have 2
templating patterns operating on the same text.

This led me to introduce the dataFromLiteral key-value pairing for the
abstract kvbackend so all backends can template non-sensitive data along
side their sensitive, cloud secrets.

I have a use case where I need a Kubernetes secret which contains a file
meant to be mounted to a container. In this file there is sensitive data
so it must be templated using the `spec.template.stringData`
functionality. Within this file there is also recurring, non-sensitive,
data that would benefit from being templated.

More specifically, I had a dozen references to a GCP project ID which
would need to be hard coded in that many locations.

I tried to supply this within the `spec.template.stringData`, but
expectedly, that data is not part of the map which renders the template;
only `spec.data` and `spec.dataFrom` are merged for that.

It would be possible to use Helm to fill Golang templates within the
lodash template, however, if feels like a bad practice to have 2
templating patterns operating on the same data.

This led me to introduce the `dataFromLiteral` key-value pairing for the
abstract kvbackend so all backends can template non-sensitive data along
side their sensitive, cloud secrets.
@jwtracy
Copy link
Author

jwtracy commented Sep 18, 2021

#835

@github-actions
Copy link

This pr is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Dec 17, 2021
@github-actions github-actions bot closed this Jan 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants