mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon: deprecate env vars set by legacy links
The environment variables set by legacy links are not particularly useful because you need to know the name of the linked container to use them, or you need to scan all enviornment variables to find them. Legacy links are deprecated / marked "legacy" since a long time, and we want to replace them with non-legacy links. This will help make the default bridge work like custom networks. For now, stop setting these environment variables inside of linking containers by default, but provide an escape hatch to allow users who still rely on these to re-enable them. The integration-cli tests `TestExecEnvLinksHost` and `TestLinksEnvs` are removed as they need to run against a daemon with legacy links env vars enabled, and a new integration test`TestLegacyLinksEnvVars` is added to fill the gap. Similarly, the docker-py test `test_create_with_links` is skipped. Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
@@ -193,15 +193,6 @@ func (s *DockerCLILinksSuite) TestLinksUpdateOnRestart(c *testing.T) {
|
||||
assert.Check(c, is.Equal(ip, realIP))
|
||||
}
|
||||
|
||||
func (s *DockerCLILinksSuite) TestLinksEnvs(c *testing.T) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
cli.DockerCmd(c, "run", "-d", "-e", "e1=", "-e", "e2=v2", "-e", "e3=v3=v3", "--name=first", "busybox", "top")
|
||||
out := cli.DockerCmd(c, "run", "--name=second", "--link=first:first", "busybox", "env").Stdout()
|
||||
assert.Assert(c, is.Contains(out, "FIRST_ENV_e1=\n"))
|
||||
assert.Assert(c, is.Contains(out, "FIRST_ENV_e2=v2"))
|
||||
assert.Assert(c, is.Contains(out, "FIRST_ENV_e3=v3=v3"))
|
||||
}
|
||||
|
||||
func (s *DockerCLILinksSuite) TestLinkShortDefinition(c *testing.T) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
cid := cli.DockerCmd(c, "run", "-d", "--name", "shortlinkdef", "busybox", "top").Stdout()
|
||||
|
||||
Reference in New Issue
Block a user