Skip to content

check container_name is not in use by another service we will create#11713

Merged
ndeloof merged 1 commit intodocker:mainfrom
ndeloof:container_name
Apr 16, 2024
Merged

check container_name is not in use by another service we will create#11713
ndeloof merged 1 commit intodocker:mainfrom
ndeloof:container_name

Conversation

@ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Apr 11, 2024

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
image

Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours
Copy link
Contributor

glours commented Apr 16, 2024

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 compose-go anymore?

@ndeloof
Copy link
Contributor Author

ndeloof commented Apr 16, 2024

@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

@ndeloof ndeloof force-pushed the container_name branch 2 times, most recently from 182b2ca to 0b41c75 Compare April 16, 2024 11:10
options.Services = project.ServiceNames()
}

err := checkContainerNameUnicity(project)
Copy link
Contributor

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>
@ndeloof ndeloof enabled auto-merge (rebase) April 16, 2024 15:20
@ndeloof ndeloof merged commit d239f0f into docker:main Apr 16, 2024
@ndeloof ndeloof deleted the container_name branch April 16, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants