diff --git a/internal/app/wwctl/container/show/main.go b/internal/app/wwctl/container/show/main.go index accc42b3..02701bab 100644 --- a/internal/app/wwctl/container/show/main.go +++ b/internal/app/wwctl/container/show/main.go @@ -24,7 +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", kernelVersion) fmt.Printf("Rootfs: %s\n", r.Rootfs) fmt.Printf("Nr nodes: %d\n", len(r.Nodes)) fmt.Printf("Nodes: %s\n", r.Nodes) diff --git a/internal/pkg/api/container/container.go b/internal/pkg/api/container/container.go index ce546b26..a76f7765 100644 --- a/internal/pkg/api/container/container.go +++ b/internal/pkg/api/container/container.go @@ -315,10 +315,6 @@ func ContainerShow(csp *wwapiv1.ContainerShowParameter) (response *wwapiv1.Conta rootFsDir := container.RootFsDir(containerName) kernelVersion := container.KernelVersion(containerName) - if kernelVersion != "" { - kernelVersion = "not found" - fmt.Printf("Kernelversion: %s\n", kernelVersion) - } nodeDB, err := node.New() if err != nil { @@ -333,7 +329,6 @@ func ContainerShow(csp *wwapiv1.ContainerShowParameter) (response *wwapiv1.Conta var nodeList []string for _, n := range nodes { if n.ContainerName.Get() == containerName { - nodeList = append(nodeList, n.Id.Get()) } }