Skip to content

Commit

Permalink
fix: updates -the command will now print the NAMESPACE of the deploye…
Browse files Browse the repository at this point in the history
…d resources

Signed-off-by: Abinand P <[email protected]>
  • Loading branch information
Abiji-2020 committed Oct 4, 2024
1 parent 498c225 commit db662a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cyctl/internal/get/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ func listResources(clientset *k8sclient.KubernetesClient, moduleNames []string)
}

headerSpacing := 20
output := "KIND" + strings.Repeat(" ", 16) + " NAME\n"
output := "KIND" + strings.Repeat(" ", 16) + " NAME" + strings.Repeat(" ", 16) + " NAMESPACE\n"
fmt.Print(output)
for _, resource := range resources {
nameSpacing := max(0, headerSpacing-len(resource.GetKind()))
fmt.Printf("%s"+strings.Repeat(" ", nameSpacing)+" %s\n", resource.GetKind(), resource.GetName())
namespaceSpacing := max(0, headerSpacing-len(resource.GetName()))
fmt.Printf("%s"+strings.Repeat(" ", nameSpacing)+" %s"+strings.Repeat(" ", namespaceSpacing)+"%s\n",
resource.GetKind(), resource.GetName(), resource.GetNamespace())
}

}
Expand Down

0 comments on commit db662a5

Please sign in to comment.