Merge pull request #542 from anderbubble/container-show-kernelversion

Fix output of wwctl container show
This commit is contained in:
Christian Goll
2022-09-19 09:03:46 +02:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -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)

View File

@@ -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())
}
}