-
Notifications
You must be signed in to change notification settings - Fork 44
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
Patch Secrets with new data, instead of appending. #201
Comments
Thanks for raising this @cpressland. Given our goal of being similar to Perhaps with an API like this would feel natural to a.patch([{"op": "replace", "path": "/data", "value":{"bbb": "bW9yZV9leGFtcGxl"}}], type="json") In #75 I've also been exploring implementing a.data = {"bbb": "bW9yZV9leGFtcGxl"}
a.apply() |
Both options look completely valid, I'd go further and suggest both approaches should be implemented, option 1 because it's what a kubectl user would expect to "just work", and option 2 because it looks more pythonic and provides a shorthand solution for small cases like this. |
Yup totally agree. The apply option is already in hand as part of that larger PR. For the JSON 6902 implementation, I expect this is just the case of adding an extra header when we make the API call. Do you have any interest in contributing this @cpressland? Otherwise I'll take a look when I can. |
More than happy to try @jacobtomlinson but my async python isn't great! I'll see if I have time to look at this in the next week or so. Thanks! |
Thanks for the offer, it actually turned out to be a small change so I threw #202 together. |
JSON 6902 style patching is now available in v0.10.0 |
Which project are you requesting an enhancement for?
kr8s
What do you need?
Currently
kr8s
exposes a.patch()
mechanism for Secret objects which allows us to add new keys:I'd like the ability to set a
replace=True
arg to the.patch()
call to have the secret data set to the contents of the patch call. Example:Alternatively, supporting JSON 6902 style patching would also be a valid solution here, similar to how kubectl handles this:
This could be implemented as a new function:
The text was updated successfully, but these errors were encountered: