Skip to content

Commit

Permalink
removed prefix from container names
Browse files Browse the repository at this point in the history
  • Loading branch information
Bence Babós committed Sep 29, 2020
1 parent 3131959 commit ce87b52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/docker/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package docker
import (
"context"
"log"
"strings"
"time"

"github.com/bbabos/swarmon/cmd/utils"
Expand Down Expand Up @@ -36,7 +37,7 @@ func GetContainers() []Container {

for i, container := range containers {
conts[i].ID = container.ID[:12]
conts[i].Name = container.Names[0]
conts[i].Name = strings.TrimPrefix(container.Names[0], "/")
conts[i].State = container.State
conts[i].Created = time.Unix(container.Created, 0).Format("2006-01-02 15:04:05")
}
Expand Down

0 comments on commit ce87b52

Please sign in to comment.