Merge pull request #1638 from baude/fastps

Make podman ps fast
This commit is contained in:
OpenShift Merge Robot
2018-10-23 09:05:20 -07:00
committed by GitHub
11 changed files with 429 additions and 256 deletions

View File

@ -311,8 +311,14 @@ func (s *PodmanSession) OutputToString() string {
// OutputToStringArray returns the output as a []string
// where each array item is a line split by newline
func (s *PodmanSession) OutputToStringArray() []string {
var results []string
output := fmt.Sprintf("%s", s.Out.Contents())
return strings.Split(output, "\n")
for _, line := range strings.Split(output, "\n") {
if line != "" {
results = append(results, line)
}
}
return results
}
// ErrorGrepString takes session stderr output and behaves like grep. it returns a bool