`mw container run` replaces a container with the same name

Open Beginner friendly
#2,125 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli

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.

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:

  1. Run mw container run --name test alpine /bin/sleep 3600
  2. Run the exact same command again
  3. 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.

Dominant language
TypeScript
Stars
8
Forks
2
Avg merge
13h 26m
Merged PRs (30d)
35

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mittwald/cli

All issues in mittwald/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.