Skip to content

Commit 4e02a06

Browse files
authored
Update documentation (#66)
1 parent 01d9bbe commit 4e02a06

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/client.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ impl Client {
7373
.await?)
7474
}
7575

76-
/// Patches a resource using the `MERGE` patch strategy.
76+
/// Patches a resource using the `MERGE` patch strategy described
77+
/// in [JSON Merge Patch](https://tools.ietf.org/html/rfc7386)
7778
/// This will fail for objects that do not exist yet.
7879
pub async fn merge_patch<T, P>(&self, resource: &T, patch: P) -> OperatorResult<T>
7980
where
@@ -85,6 +86,9 @@ impl Client {
8586
}
8687

8788
/// Patches a resource using the `APPLY` patch strategy.
89+
/// This is a [_Server-Side Apply_](https://kubernetes.io/docs/reference/using-api/server-side-apply/)
90+
/// and the merge strategy can differ from field to field and will be defined by the
91+
/// schema of the resource in question.
8892
/// This will _create_ or _update_ existing resources.
8993
pub async fn apply_patch<T, P>(&self, resource: &T, patch: P) -> OperatorResult<T>
9094
where
@@ -111,9 +115,10 @@ impl Client {
111115
.await?)
112116
}
113117

114-
/// Replaces a resource.
115118
/// This will _update_ an existing resource.
116-
/// NOTE: I do not know what the difference is between `update` and `apply_patch` for updates.
119+
/// The operation is called `replace` in the Kubernetes API.
120+
/// While a `patch` can just update a partial object
121+
/// a `update` will always replace the full object.
117122
pub async fn update<T>(&self, resource: &T) -> OperatorResult<T>
118123
where
119124
T: Clone + DeserializeOwned + Meta + Serialize,

0 commit comments

Comments
 (0)