Helper struct for patch_status
with Patch::Apply
#1465
Kritzefitz
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Hey, thanks for this. This seems accurate to me, and I am also a bit annoyed at the state of things w.r.t. apply implicits and things we need to forcibly option out. From a first glance, I think your idea here might be a good one for client extensions #1032 You could possibly hide some of this inside of a module as well by having a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was trying to modify the status of a managed CR somewhat like this:
However, this fails with the following error:
This was a surprise to me, because this example on the website, does basically the same. AIUI, the only relevant difference in my scenario is that I'm using
Patch::Apply
where the example is usingPatch::Merge
.The root of the problem seems to be, that the api server expects
apiVersion
andkind
to be present in the input for server side apply patches, whereas it does not require these fields for strategic merges.This seems annoying to me, because using server side apply for status update generally seems like a good idea (please correct me if I'm wrong here). But currently there seems to be no easy solution to construct an appropriate payload for that patch. Using the proper
CustomResource
type produces a payload that works, but depending on how its spec is defined, it might be impossible to construct a payload that updates only thestatus
.To make it easier to construct appropriate payloads, I think a helper struct like this would be useful:
This mimics the serialization of the actual resource, but only serializes the status subresource and enough metadata to identify the exact object being updated.
I've only talked about updating
status
above, but I think this concept could also be applied to updates to other subresources, though I'm not familiar enough with the semantics of other resources to hash out the details.What do you think? Would this be a useful addition to kube?
Beta Was this translation helpful? Give feedback.
All reactions