Skip to content

Commit cf91370

Browse files
fix(rest-plugin): show missing target if missing
If the target is meant to be there, but it's missing, state that. Signed-off-by: Tiago Castro <[email protected]>
1 parent 7a2ea16 commit cf91370

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

control-plane/plugin/src/resources/volume.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,15 @@ pub struct VolumesArgs {
4040
impl CreateRow for openapi::models::Volume {
4141
fn row(&self) -> Row {
4242
let state = &self.state;
43+
let target_node = match state.target.clone().map(|t| t.node) {
44+
Some(node) => Some(node),
45+
None if self.spec.target.is_some() => Some("<missing>".to_string()),
46+
None => None,
47+
};
4348
row![
4449
state.uuid,
4550
self.spec.num_replicas,
46-
optional_cell(state.target.clone().map(|t| t.node)),
51+
optional_cell(target_node),
4752
optional_cell(state.target.as_ref().and_then(target_protocol)),
4853
state.status.clone(),
4954
::utils::bytes::into_human(state.size),

0 commit comments

Comments
 (0)