Move "not found" presentation to CLI

This commit is contained in:
Jonathon Anderson
2022-09-16 21:56:39 +00:00
parent 14b45e37c0
commit 4661b02a3d
2 changed files with 5 additions and 4 deletions

View File

@@ -24,8 +24,12 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
if !ShowAll {
fmt.Printf("%s\n", r.Rootfs)
} else {
kernelVersion := r.KernelVersion
if kernelVersion == "" {
kernelVersion = "not found"
}
fmt.Printf("Name: %s\n", r.Name)
fmt.Printf("KernelVersion: %s\n", r.KernelVersion)
fmt.Printf("KernelVersion: %s\n", kernelVersion)
fmt.Printf("Rootfs: %s\n", r.Rootfs)
fmt.Printf("Nr nodes: %d\n", len(r.Nodes))
fmt.Printf("Nodes: %s\n", r.Nodes)

View File

@@ -315,9 +315,6 @@ func ContainerShow(csp *wwapiv1.ContainerShowParameter) (response *wwapiv1.Conta
rootFsDir := container.RootFsDir(containerName)
kernelVersion := container.KernelVersion(containerName)
if kernelVersion == "" {
kernelVersion = "not found"
}
nodeDB, err := node.New()
if err != nil {