CLI does not fill NetworkAttachmentConfig.Target correctly
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
The CLI used to put whatever reference to a network the user entered directly into NetworkAttachmentConfig.Target. This field is documented to only contain a network ID, so this was the wrong behavior. It turned out that the daemon was automatically rewriting these names into IDs, which is bad because the daemon shouldn't be modifying the spec supplied by the user. The CLI behavior was fixed as part of https://github.com/moby/moby/pull/32062, and there was a lot of discussion about this in the PR:
https://github.com/moby/moby/pull/32062#discussion_r108245707
https://github.com/moby/moby/pull/32062#discussion_r110199017
https://github.com/moby/moby/pull/32062#issuecomment-292242071
The daemon still rewrites names into IDs for backward compatibility, but this code path isn't meant to be used going forward, and ideally should only be enabled for older API versions.
The CLI's behavior appears to have regressed in #62. It's no longer using the ID as it should. The problem is hidden by the magic rewriting in the daemon.
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
Read the behavior discussed in PR #32062 and the regression described in issue #62, then trace where the CLI constructs NetworkAttachmentConfig.Target. Confirm the CLI supplies a network ID rather than a name, and add or update coverage for that behavior if the relevant test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100