`mw container run` replaces a container with the same name
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8
- Forks
- 2
- Avg merge
- 13h 26m
- Merged PRs (30d)
- 35
Description
Describe the bug A clear and concise description of what the bug is.
Repeated invocations of mw container run with a --name <NAME> flag replace an already existing containers with the same name.
This behaviour is surprising to a user, and inconsistent with (for example) docker run.
To Reproduce Steps to reproduce the behavior:
- Run
mw container run --name test alpine /bin/sleep 3600 - Run the exact same command again
- Observe that the first container is replaced without any mention
Expected behavior
I would expect for the second command to be denied. The equivalent docker error message in this case is Conflict. The container name "/<NAME>" is already in use by container "<ID>". You have to remove (or rename) that container to be able to reuse that name.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the implementation and tests for the mw container run command, then reproduce the duplicate-name case with the commands in the issue. Make the second invocation fail without replacing the existing container, and verify the existing container remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100