Skip to content

Commit

Permalink
Force reset nodes if storage is modified
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Sep 20, 2022
1 parent c0ad4b7 commit a1f7b7f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions kiss/api/src/box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,6 @@ pub mod request {
pub access: BoxAccessSpec,
pub machine: BoxMachineSpec,
pub power: Option<BoxPowerSpec>,
pub reset: bool,
}
}
10 changes: 9 additions & 1 deletion kiss/gateway/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
}));
Expand Down
1 change: 1 addition & 0 deletions templates/kiss/tasks/commission/submit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
power:
type: Ipmi
address: "{{ ipmi_address.stdout }}"
reset: "{{ not kiss_storage_exists }}"

0 comments on commit a1f7b7f

Please sign in to comment.