From 8871edc1a088869d88b5960a5bfd66a50b728af1 Mon Sep 17 00:00:00 2001 From: Nariyuki Saito Date: Thu, 24 Nov 2022 00:05:06 +0900 Subject: [PATCH] use service name as service ID --- pkg/commands/docker.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/commands/docker.go b/pkg/commands/docker.go index df1f1973..70f4e88d 100644 --- a/pkg/commands/docker.go +++ b/pkg/commands/docker.go @@ -244,22 +244,21 @@ func (c *DockerCommand) GetServices() ([]*Service, error) { } composeCommand := c.Config.UserConfig.CommandTemplates.DockerCompose - output, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("%s config --hash=*", composeCommand)) + output, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("%s config --services", composeCommand)) if err != nil { return nil, err } // output looks like: - // service1 998d6d286b0499e0ff23d66302e720991a2asdkf9c30d0542034f610daf8a971 - // service2 asdld98asdklasd9bccd02438de0994f8e19cbe691feb3755336ec5ca2c55971 + // service1 + // service2 lines := utils.SplitLines(output) services := make([]*Service, len(lines)) for i, str := range lines { - arr := strings.Split(str, " ") services[i] = &Service{ - Name: arr[0], - ID: arr[1], + Name: str, + ID: str, OSCommand: c.OSCommand, Log: c.Log, DockerCommand: c,