Fixes for kernel identification within the container

This commit is contained in:
Gregory Kurtzer
2022-02-16 04:48:17 +00:00
parent 5a0c13225e
commit a6c793caca
2 changed files with 52 additions and 27 deletions

View File

@@ -3,7 +3,6 @@ package list
import (
"fmt"
"os"
"path"
"github.com/hpcng/warewulf/internal/pkg/container"
"github.com/hpcng/warewulf/internal/pkg/node"
@@ -27,14 +26,14 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
nodemap[n.ContainerName.Get()]++
}
fmt.Printf("%-25s %-6s %-6s\n", "CONTAINER NAME", "NODES", "KERNEL")
fmt.Printf("%-25s %-6s %-6s\n", "CONTAINER NAME", "NODES", "KERNEL VERSION")
for _, source := range sources {
if nodemap[source] == 0 {
nodemap[source] = 0
}
kernel := container.KernelFind(source)
fmt.Printf("%-25s %-6d %s\n", source, nodemap[source], path.Base(kernel))
kernelVersion := container.KernelVersion(source)
fmt.Printf("%-25s %-6d %s\n", source, nodemap[source], kernelVersion)
}
return nil