From a1f7b7f3f2435293992bbcdcaa5f5ebe9feb1710 Mon Sep 17 00:00:00 2001 From: Ho Kim Date: Tue, 20 Sep 2022 15:55:27 +0000 Subject: [PATCH] Force reset nodes if storage is modified --- kiss/api/src/box.rs | 1 + kiss/gateway/src/main.rs | 10 +++++++++- templates/kiss/tasks/commission/submit.yaml | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/kiss/api/src/box.rs b/kiss/api/src/box.rs index 40f852be..88fbaab3 100644 --- a/kiss/api/src/box.rs +++ b/kiss/api/src/box.rs @@ -265,5 +265,6 @@ pub mod request { pub access: BoxAccessSpec, pub machine: BoxMachineSpec, pub power: Option, + pub reset: bool, } } diff --git a/kiss/gateway/src/main.rs b/kiss/gateway/src/main.rs index 09bdaa71..71782d98 100644 --- a/kiss/gateway/src/main.rs +++ b/kiss/gateway/src/main.rs @@ -120,7 +120,15 @@ async fn get_commission( }, "status": BoxStatus { state: BoxState::Ready, - bind_group: r#box.status.as_ref().and_then(|status| status.bind_group.as_ref()).cloned(), + bind_group: if query.reset { + None + } else { + r#box + .status + .as_ref() + .and_then(|status| status.bind_group.as_ref()) + .cloned() + }, last_updated: Utc::now(), }, })); diff --git a/templates/kiss/tasks/commission/submit.yaml b/templates/kiss/tasks/commission/submit.yaml index f7a6efb7..74b46c28 100644 --- a/templates/kiss/tasks/commission/submit.yaml +++ b/templates/kiss/tasks/commission/submit.yaml @@ -14,3 +14,4 @@ power: type: Ipmi address: "{{ ipmi_address.stdout }}" + reset: "{{ not kiss_storage_exists }}"