refactor: client StartContainer pass serviceID

This commit is contained in:
Pavel Sviderski
2025-02-11 16:47:52 +10:00
parent a477db6b16
commit 76a9f8e8b6
3 changed files with 27 additions and 13 deletions
+2 -2
View File
@@ -214,7 +214,7 @@ func (cli *Client) runContainer(
return resp, fmt.Errorf("create container: %w", err)
}
if err = cli.StartContainer(ctx, resp.ID, machine.Name); err != nil {
if err = cli.StartContainer(ctx, serviceID, resp.ID); err != nil {
return resp, fmt.Errorf("start container: %w", err)
}
@@ -319,7 +319,7 @@ func (cli *Client) InspectService(ctx context.Context, id string) (api.Service,
serviceID := containers[0].Container.ServiceID()
for _, mc := range containers[1:] {
if mc.Container.ServiceID() != serviceID {
return svc, fmt.Errorf("multiple services found with name: %s", id)
return svc, fmt.Errorf("multiple services found with name '%s', use the service ID instead", id)
}
}
}