cmd, ps: add .Status as synonym for .State

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-04-27 09:40:56 +02:00
parent e88b2dc0c9
commit edbdbe5b3a
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
1 changed files with 6 additions and 1 deletions

View File

@ -223,7 +223,7 @@ func createPsOut() (string, string) {
}
headers := defaultHeaders
row += "{{.ID}}"
row += "\t{{.Image}}\t{{.Command}}\t{{.CreatedHuman}}\t{{.State}}\t{{.Ports}}\t{{.Names}}"
row += "\t{{.Image}}\t{{.Command}}\t{{.CreatedHuman}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}"
if listOpts.Pod {
headers += "\tPOD ID\tPODNAME"
@ -282,6 +282,11 @@ func (l psReporter) State() string {
return state
}
// Status is a synonym for State()
func (l psReporter) Status() string {
return l.State()
}
// Command returns the container command in string format
func (l psReporter) Command() string {
return strings.Join(l.ListContainer.Command, " ")