-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Make Api::apply as an alias for Api::patch with server-side mode #174
Comments
Perhaps Api::update would also be a useable name, given there are two ways to do it. |
A potential, require the whole /// Server side apply a yaml patch over a named resource
///
pub async fn apply(&self, name: &str, patch: &K) -> Result<K>
where
K: Serialize,
{
// TODO: ApplyParams shorthand? for now...
use crate::api::PatchStrategy;
let ssapply = PatchParams {
patch_strategy: PatchStrategy::Apply,
// always override on conflicts
force: true,
// owner of the fields: (us)
field_manager: Some(env!("CARGO_PKG_NAME").into()),
..Default::default()
};
let bytes = serde_yaml::to_vec(&patch)?;
let req = self.api.patch(name, &ssapply, bytes)?;
self.client.request::<K>(req).await
} Now of course this does not let people supply partial patches like the So lacking a good solution to #129 (which I think would let us customize that behaviour / hook it into our serde skip_serialize behavior), it's not a good plan to let people supply partial yaml to server side apply on CRDs. If they need partial application, they need to stick with json merge until we have support for that. |
This is probably a mistake. Going to just do this with a constructor alias on PatchParams. |
Yeah.. |
So we have a nice interface to server-side apply (limit to kubernetes version >=1.16)
The text was updated successfully, but these errors were encountered: