-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Allow specifying secret values as strings #22059
Conversation
Gut reaction is I think this has the highest probability of success of all the options i've seen for this. |
is this really worthwhile? |
Not sure yet. Creating secrets from templates or user input is currently pretty rough. |
Definitely the cleanest option. |
I think we should reconsider this for 1.3 |
Why? Is this really a significant source of user pain? |
Yes. It makes any for of config templates extremely difficult to use for On Apr 30, 2016, at 1:23 AM, Tim Hockin notifications@github.com wrote: Why? Is this really a significant source of user pain? — |
ok. I guess I buy this, but I hate the solution. No I do not have a On Sat, Apr 30, 2016 at 9:27 AM, Clayton Coleman notifications@github.com
|
I agree that it's a "worst, except for all the others" sort of thing |
Least worst amongst a curated array of terrible solutions On Sun, May 1, 2016 at 9:52 AM, Jordan Liggitt notifications@github.com
|
219ae60
to
aa8c9ed
Compare
GCE e2e build/test passed for commit 83381ea. |
@liggitt PR needs rebase |
@thockin @bgrant0607 are you all ok with proceeding with something like this? |
@bgrant0607 this is a one way conversion on write to enable templates or other writers that don't have base64 conversion capabilities. Output is always base64, so secret consumers aren't affected |
@liggitt Ah, I didn't read the description carefully enough. So it breaks the rule that the server shouldn't ever mutate fields populated by the client. :-) I definitely would not want to do this anywhere else, since it would break kubectl apply and probably other things. However, users shouldn't use kubectl apply on secrets, so that reason isn't relevant in this case. Are there other get+diff or hash implementations we need to be concerned out? |
On Jun 28, 2016, at 11:46 PM, Brian Grant notifications@github.com wrote: @liggitt https://github.com/liggitt Ah, I didn't read the description So it breaks the rule that the server shouldn't ever mutate fields I definitely would not want to do this anywhere else, since it would break Isn't apply already broken on new fields we add (even if backward compat)? |
@smarterclayton New fields whose purpose overlaps existing fields break all forms of updates. So, yes, I'm not suggesting new string fields. Rather than a |
@bgrant0607 I had considered something like that (either a field or an annotation) but I wasn't sure if it made sense to persist that bool. I guess we could always reset it to false prior to storing it in etcd. |
I was hoping to limit the changes to the unmarshal phase, especially since I don't really want protobuf to have to change for this. I also like the ability to do it per value, rather than applying to the whole object (makes a patch nice if you want to update one key's value using a string value) Also, a separate boolean field that says "change the meaning of this other field" means that old servers can accidentally accept string data as binary data |
I do like the per-value application as well |
I dislike the precedent this sets, and the lack of discoverability. The latter could be addressed via documentation on the API fields, but I'm going to throw out a few other ideas first. We could use an alternative API endpoint (a subresource or alternate resource path) to indicate that a different type is being sent, which would contain both a string map and a byte map, but the object created and persisted would only contain the current Secret resource (bytes). Or, we could add the string map to Secret, and clear it once the object was created, similar to the |
On Jun 29, 2016, at 6:57 PM, Brian Grant notifications@github.com wrote: @liggitt https://github.com/liggitt @ncdc https://github.com/ncdc I dislike the precedent this sets, and the lack of discoverability. The We could use an alternative API endpoint (a subresource or alternate We'd have to create an alternate resource path, since subresources wouldn't Or, we could add the string map to Secret, and clear it once the object was I'm fine with that as well. |
I agree on precedent (weird APIs-within-an-API) and discoverability. Of the options, I like a peer I would expect the The one shortcoming is that there's no way to tell if the server knows about |
Which is generally a problem with any net-new field we add already and
for which --validate can shield you.
|
opened #28263 with the proposed peer field approach |
closing in favor of #28263 |
Proof of concept for #19575 (comment), intended to make it possible to produce
Secret
definitions from templates.Allows specifying secret values to the API in v1.Secrets as
"string:literal string value"
, in addition to the existing base64 []byte serialization ("bGl0ZXJhbCBzdHJpbmcgdmFsdWU="
). The conversion is one-way, output is always base64 for backwards compatibility. No additional escaping/unescaping or manipulation of the content is done. The conversion process is:string:
, remove thestring:
prefix and use the remaining bytes as the content.With this change, a Secret could be created like this:
This change is