port: fix container name in error message (#9909)

The error message is using V1 separator hardcoded, it should be using the configured separator value.

Signed-off-by: Tiago Silva <Tiago.MB.Silva@edu.azores.gov.pt>
This commit is contained in:
Tiago Silva 2022-10-13 18:47:35 +00:00 committed by GitHub
parent 3892e9cbc4
commit 8b89721476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ func (s *composeService) Port(ctx context.Context, projectName string, service s
return "", 0, err
}
if len(list) == 0 {
return "", 0, fmt.Errorf("no container found for %s_%d", service, options.Index)
return "", 0, fmt.Errorf("no container found for %s%s%d", service, api.Separator, options.Index)
}
container := list[0]
for _, p := range container.Ports {