-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: emitStringData
boolean for secretGenerator
#5894
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
base: master
Are you sure you want to change the base?
feat: emitStringData
boolean for secretGenerator
#5894
Conversation
This PR has multiple commits, and the default merge method is: merge. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
14da6ae
to
905d18d
Compare
stringData
from secretGeneratorstringData
from secretGenerator
/assign |
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 🚀
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: matheuscscp, stealthybox The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
905d18d
to
9e14bdb
Compare
I've just done a fresh rebase. |
@stealthybox
|
How about |
@matheuscscp For example, in the case of |
9e14bdb
to
2e90352
Compare
bab4e87
to
67fc288
Compare
@koba1t, thanks for pointing out this out.
The 4 cases where fields override using a different encoding output duplicate fields. Here is an example of what that fix could look like: |
Regarding the field name, I understand the concern of In the most recent issue, A separate end-user suggests the boolean field should be called The title of unrelated issue (#1261) is "Support StringData option in SecretArgs". Considering end-user, contributor, and maintainer responses,
I'd also challenge that
The new field isn't a passthrough value field -- it changes generator behavior.
This is fair. there are a lot of fields when you consider input fields like
I disagree that I think these are decent options for field names:
The default behavior of a configMapGenerator already includes heuristic auto-encoding behavior for binaryData, and that doesn't show up in any field names. It's just the way a kustomize generator works. Thanks for considering these points. Do you like |
Yeah this field has to explain itself, it has to have |
unrelated to field names, here's one way to fix the existing broken configMapGenerator behavior: |
I think "stringData" would be a deceiving name for this new field. My suggestion today is "emitStringData". |
67fc288
to
c0b3af1
Compare
I've proactively renamed the field to |
stringData
from secretGeneratoremitStringData
boolean for secretGenerator
@koba1t and I considered in our Slack dm's whether a string value field could work: field: "data" # "stringData" | "binaryData" This could be a generic way to solve this problem for both ConfigMap and Secret generators, but it also creates more error states and is harder to grep for in existing code + discover in auto-complete. I prefer the |
Hi friends, if there's no further contest on the field name, I'd love to get this reviewed for a merge. I want to draft a change for the merge behavior bugfix in stealthybox@e95e854 . After these changes make their way into kustomize, kubectl needs to update kustomize before we can pull this feature into Flux. |
This allows users to pass
emitStringData: true
to the secretGenerator, alongside thetype
option.When enabled, UTF-8 strings are output in plainText stringData, and non-UTF strings and any binary data fallback to the default behavior of being base64 encoded in
data
.This is very similar to the default, kyaml behavior of loading values into ConfigMap's
data
andbinaryData
fields.This feature provides a general U/X improvement for people using kustomize interactively, and also allows Flux users to template into generated secrets.
(Flux users already can and do template into ConfigMaps, so we want to give people more secure mechanisms in kustomize-controller)
resolves #5142 #1444 #1261 #793