You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: kube-core/src/params.rs
+40
Original file line number
Diff line number
Diff line change
@@ -444,6 +444,8 @@ impl PostParams {
444
444
///
445
445
/// See [kubernetes patch docs](https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment) for the older patch types.
446
446
///
447
+
/// Note that applying an invalid patch will **not** always return an error. See an example of such a case below.
448
+
///
447
449
/// Note that patches have different effects on different fields depending on their merge strategies.
448
450
/// These strategies are configurable when deriving your [`CustomResource`](https://docs.rs/kube-derive/*/kube_derive/derive.CustomResource.html#customizing-schemas).
449
451
///
@@ -473,6 +475,44 @@ impl PostParams {
473
475
/// };
474
476
/// let patch = Patch::Apply(&r);
475
477
/// ```
478
+
/// # Invalid Patches
479
+
///
480
+
/// In this example patch contains a `PodSpec` and **not** a complete or partial `Pod`.
481
+
/// This patch is invalid as the full structure of a resource is required.
482
+
/// The invalid patch will be accepted by the cluster, but no changes will be made.
483
+
///
484
+
/// Using serve-side style [`Apply`](Patch::Apply) patches mitigates this issue.
485
+
///
486
+
/// ```no_run
487
+
/// use k8s_openapi::api::core::v1::{Pod, PodSpec};
0 commit comments