feat: service name in ps output

This commit is contained in:
2021-12-31 12:59:31 +01:00
parent 95d385c420
commit 866cdd1f29
2 changed files with 12 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import (
"coopcloud.tech/abra/pkg/client"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/formatter"
"coopcloud.tech/abra/pkg/service"
stack "coopcloud.tech/abra/pkg/upstream/stack"
"github.com/buger/goterm"
dockerFormatter "github.com/docker/cli/cli/command/formatter"
@ -70,7 +71,7 @@ func showPSOutput(c *cli.Context, app config.App, cl *dockerClient.Client) {
logrus.Fatal(err)
}
tableCol := []string{"image", "created", "status", "state", "ports"}
tableCol := []string{"service name", "image", "created", "status", "state", "ports"}
table := formatter.CreateTable(tableCol)
for _, container := range containers {
@ -81,6 +82,7 @@ func showPSOutput(c *cli.Context, app config.App, cl *dockerClient.Client) {
}
tableRow := []string{
service.ContainerToServiceName(container.Names, app.StackName()),
formatter.RemoveSha(container.Image),
formatter.HumanDuration(container.Created),
container.Status,