Skip to content

Commit

Permalink
Specify field manager when patching resources in sessionspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
garryod committed Jul 5, 2024
1 parent 9072114 commit 05192af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion sessionspaces/src/resources/config_maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ pub async fn create_configmap(
configmaps
.patch(
NAME,
&PatchParams::default(),
&PatchParams {
field_manager: Some("sessionspaces".to_string()),
..Default::default()
},
&Patch::Apply(&ConfigMap {
metadata: ObjectMeta {
name: Some(NAME.to_string()),
Expand Down
10 changes: 8 additions & 2 deletions sessionspaces/src/resources/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ pub async fn create_namespace(
let api = Api::<Namespace>::all(k8s_client.clone());
api.patch(
&namespace,
&PatchParams::default(),
&PatchParams {
field_manager: Some("sessionspaces".to_string()),
..Default::default()
},
&Patch::Apply(&Namespace {
metadata: ObjectMeta {
name: Some(namespace.clone()),
Expand Down Expand Up @@ -67,7 +70,10 @@ mod tests {
async fn create_new_namespace() {
let mut server = Server::new_async().await;
let mock_patch_test_namespace = server
.mock("PATCH", "/api/v1/namespaces/test?")
.mock(
"PATCH",
"/api/v1/namespaces/test?&fieldManager=sessionspaces",
)
.with_status(201)
.with_header("content-type", "application/json")
.with_body(
Expand Down

0 comments on commit 05192af

Please sign in to comment.