-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check container_name is not in use by another service we will create #11713
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ho can we add a test to be sure we won't have regression in future as this check is managed here now and not in |
@glours I have a test case ready but need to wait for compose-spec/compose-go#619 to be merged otherwise test will fail as compose-go will prevent loading compose.yaml file with same container_name used by services |
182b2ca
to
0b41c75
Compare
pkg/compose/create.go
Outdated
func (s *composeService) create(ctx context.Context, project *types.Project, options api.CreateOptions) error { | ||
if len(options.Services) == 0 { | ||
options.Services = project.ServiceNames() | ||
} | ||
|
||
err := checkContainerNameUnicity(project) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also call this on compose config
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
What I did
check container_name is not in use by another service we will create
Related issue
see compose-spec/compose-go#619
(not mandatory) A picture of a cute animal, if possible in relation to what you did