From bf099f53d5078414fc5d6fb11190ffc578f6b5fb Mon Sep 17 00:00:00 2001 From: sinhaashish Date: Tue, 19 Mar 2024 12:50:18 +0000 Subject: [PATCH] fix(serde): fix serialization error for get nodes Signed-off-by: sinhaashish --- control-plane/plugin/src/resources/node.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/control-plane/plugin/src/resources/node.rs b/control-plane/plugin/src/resources/node.rs index 8fd59d887..7bd339c1d 100644 --- a/control-plane/plugin/src/resources/node.rs +++ b/control-plane/plugin/src/resources/node.rs @@ -118,7 +118,14 @@ impl ListWithArgs for Nodes { Ok(nodes) => { let node_display = NodeDisplayLabels::new_nodes(nodes.clone().into_body(), args.show_labels()); - print_table(output, node_display); + match output { + OutputFormat::Yaml | OutputFormat::Json => { + print_table(output, node_display.inner); + } + OutputFormat::None => { + print_table(output, node_display); + } + } } Err(e) => { return Err(Error::ListNodesError { source: e }); @@ -216,7 +223,14 @@ impl GetWithArgs for Node { Ok(node) => { let node_display = NodeDisplayLabels::new(node.clone().into_body(), args.show_labels()); - print_table(output, node_display); + match output { + OutputFormat::Yaml | OutputFormat::Json => { + print_table(output, node_display.inner); + } + OutputFormat::None => { + print_table(output, node_display); + } + } } Err(e) => { return Err(Error::GetNodeError {