Skip to content

Commit

Permalink
fix(getNode): return single element in get node
Browse files Browse the repository at this point in the history
Signed-off-by: sinhaashish <ashi.sinha.87@gmail.com>
  • Loading branch information
sinhaashish committed Mar 20, 2024
1 parent 919e1a1 commit 67531ea
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions control-plane/plugin/src/resources/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,17 @@ impl GetWithArgs for Node {
type Args = GetNodeArgs;
async fn get(id: &Self::ID, args: &Self::Args, output: &utils::OutputFormat) -> PluginResult {
match RestClient::client().nodes_api().get_node(id).await {
Ok(node) => {
let node_display =
NodeDisplayLabels::new(node.clone().into_body(), args.show_labels());
match output {
OutputFormat::Yaml | OutputFormat::Json => {
print_table(output, node_display.inner);
}
OutputFormat::None => {
print_table(output, node_display);
}
Ok(node) => match output {
OutputFormat::Yaml | OutputFormat::Json => {
print_table(output, node.clone().into_body());
}
}
OutputFormat::None => {
print_table(
output,
NodeDisplayLabels::new(node.into_body(), args.show_labels()),
);
}
},
Err(e) => {
return Err(Error::GetNodeError {
id: id.to_string(),
Expand Down

0 comments on commit 67531ea

Please sign in to comment.