Remove extra output lines after the version
Some commands, like crio and runc, dump extra line noise after the --version even though they have a long version.pull/12085/head
parent
46c3797169
commit
4f6ee47f28
|
@ -69,7 +69,10 @@ var versionCmd = &cobra.Command{
|
|||
klog.Warningf("error getting %s's version: %v", k, err)
|
||||
data[k] = "error"
|
||||
} else {
|
||||
data[k] = strings.TrimSpace(rr.Stdout.String())
|
||||
version := rr.Stdout.String()
|
||||
// remove extra lines after the version
|
||||
version = strings.Split(version, "\n")[0]
|
||||
data[k] = strings.TrimSpace(version)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue