integration-cli: remove uses of "runconfig"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-07-20 21:02:38 +02:00
parent f776cd6922
commit ab5d348b77
5 changed files with 29 additions and 34 deletions

View File

@@ -30,7 +30,6 @@ import (
"github.com/docker/docker/integration-cli/daemon"
"github.com/docker/docker/internal/testutils/specialimage"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/testutil"
testdaemon "github.com/docker/docker/testutil/daemon"
"github.com/docker/docker/testutil/fakecontext"
@@ -293,7 +292,7 @@ func (s *DockerCLIRunSuite) TestRunWithNetAliasOnDefaultNetworks(c *testing.T) {
for _, nw := range defaults {
out, _, err := dockerCmdWithError("run", "-d", "--net", nw, "--net-alias", "alias_"+nw, "busybox", "top")
assert.ErrorContains(c, err, "")
assert.Assert(c, is.Contains(out, runconfig.ErrUnsupportedNetworkAndAlias.Error()))
assert.Assert(c, is.Contains(out, "network-scoped alias is supported only for containers in user defined networks"))
}
}
@@ -2429,7 +2428,7 @@ func (s *DockerCLIRunSuite) TestRunModeUTSHost(c *testing.T) {
}
out = dockerCmdWithFail(c, "run", "-h=name", "--uts=host", "busybox", "ps")
assert.Assert(c, is.Contains(out, runconfig.ErrConflictUTSHostname.Error()))
assert.Assert(c, is.Contains(out, "conflicting options: hostname and the UTS mode"))
}
func (s *DockerCLIRunSuite) TestRunTLSVerify(c *testing.T) {
@@ -3297,12 +3296,12 @@ func (s *DockerCLIRunSuite) TestRunContainerNetModeWithDNSMacHosts(c *testing.T)
}
out, _, err = dockerCmdWithError("run", "--dns", "1.2.3.4", "--net=container:parent", "busybox")
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkAndDNS.Error()) {
if err == nil || !strings.Contains(out, "conflicting options: dns and the network mode") {
c.Fatalf("run --net=container with --dns should error out")
}
out, _, err = dockerCmdWithError("run", "--add-host", "test:192.168.2.109", "--net=container:parent", "busybox")
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkHosts.Error()) {
if err == nil || !strings.Contains(out, "conflicting options: custom host-to-IP mapping and the network mode") {
c.Fatalf("run --net=container with --add-host should error out")
}
}
@@ -3313,17 +3312,17 @@ func (s *DockerCLIRunSuite) TestRunContainerNetModeWithExposePort(c *testing.T)
cli.DockerCmd(c, "run", "-d", "--name", "parent", "busybox", "top")
out, _, err := dockerCmdWithError("run", "-p", "5000:5000", "--net=container:parent", "busybox")
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkPublishPorts.Error()) {
if err == nil || !strings.Contains(out, "conflicting options: port publishing and the container type network mode") {
c.Fatalf("run --net=container with -p should error out")
}
out, _, err = dockerCmdWithError("run", "-P", "--net=container:parent", "busybox")
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkPublishPorts.Error()) {
if err == nil || !strings.Contains(out, "conflicting options: port publishing and the container type network mode") {
c.Fatalf("run --net=container with -P should error out")
}
out, _, err = dockerCmdWithError("run", "--expose", "5000", "--net=container:parent", "busybox")
if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkExposePorts.Error()) {
if err == nil || !strings.Contains(out, "conflicting options: port exposing and the container type network mode") {
c.Fatalf("run --net=container with --expose should error out")
}
}
@@ -3538,7 +3537,7 @@ func (s *DockerCLIRunSuite) TestContainerWithConflictingSharedNetwork(c *testing
// Connecting to the user defined network must fail
out, _, err := dockerCmdWithError("network", "connect", "testnetwork1", "second")
assert.ErrorContains(c, err, "")
assert.Assert(c, is.Contains(out, runconfig.ErrConflictSharedNetwork.Error()))
assert.Assert(c, is.Contains(out, "container sharing network namespace with another container or host cannot be connected to any other network"))
}
func (s *DockerCLIRunSuite) TestContainerWithConflictingNoneNetwork(c *testing.T) {
@@ -3552,7 +3551,7 @@ func (s *DockerCLIRunSuite) TestContainerWithConflictingNoneNetwork(c *testing.T
// Connecting to the user defined network must fail
out, _, err := dockerCmdWithError("network", "connect", "testnetwork1", "first")
assert.ErrorContains(c, err, "")
assert.Assert(c, is.Contains(out, runconfig.ErrConflictNoNetwork.Error()))
assert.Assert(c, is.Contains(out, "container cannot be connected to multiple networks with one of the networks in private (none) mode"))
// create a container connected to testnetwork1
cli.DockerCmd(c, "run", "-d", "--net=testnetwork1", "--name=second", "busybox", "top")
cli.WaitRun(c, "second")