Skip to content
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

daemon: add a deprecation warning about links on the default nw #47427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akerouanton
Copy link
Member

- What I did

This feature is deprecated and removed in a couple releases, when we make the default bridge network just another bridge network.

- How to verify it

$ docker run --rm -d --name=c0 alpine top
$ docker run --rm -it --link=c0 --name=c1 alpine true
WARNING: Links on the default bridge network are deprecated and will be removed in a future release. You should use a custom network instead.

- Description for the changelog

  • The Engine now returns a deprecation warning when a container connected to the default bridge is created with links specified.

This feature will be deprecated and removed in a couple releases,
when we make the default bridge network just another bridge network.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
@@ -113,6 +113,10 @@ func (daemon *Daemon) containerCreate(ctx context.Context, daemonCfg *configStor
return containertypes.CreateResponse{Warnings: warnings}, errdefs.InvalidParameter(err)
}

if runtime.GOOS == "linux" && (opts.params.HostConfig.NetworkMode.IsDefault() || opts.params.HostConfig.NetworkMode.IsBridge()) && len(opts.params.HostConfig.Links) > 0 {
warnings = append(warnings, "Links on the default bridge network are deprecated and will be removed in a future release. You should use a custom network instead.")
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps slightly shorter, and remove the pronoun;

Suggested change
warnings = append(warnings, "Links on the default bridge network are deprecated and will be removed in a future release. You should use a custom network instead.")
warnings = append(warnings, "Links on the default bridge network are deprecated and will be removed in a future release. Use a custom network instead.")

What's the situation on Windows? Will we remove --link for the default network there as well?

@vvoland
Copy link
Contributor

vvoland commented Feb 26, 2024

@akerouanton PTAL

@vvoland vvoland modified the milestones: 26.0.0, 27.0.0 Mar 14, 2024
@vvoland vvoland modified the milestones: 26.1.0, 27.0.0 Apr 10, 2024
@neersighted neersighted modified the milestones: 27.0.0, v-future May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants