rename "image" vars to prevent conflicts with imports

We have many "image" packages, so these vars easily conflict/shadow
imports. Let's rename them (and in some cases use a const) to
prevent that.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-01-19 12:31:25 +01:00
parent 4a40d10b60
commit 66cf6e3a7a
19 changed files with 107 additions and 107 deletions

View File

@@ -469,13 +469,13 @@ func (s *DockerCLIVolumeSuite) TestVolumeCliInspectWithVolumeOpts(c *testing.T)
func (s *DockerCLIVolumeSuite) TestDuplicateMountpointsForVolumesFrom(c *testing.T) {
testRequires(c, DaemonIsLinux)
const image = "vimage"
buildImageSuccessfully(c, image, build.WithDockerfile(`
const imgName = "vimage"
buildImageSuccessfully(c, imgName, build.WithDockerfile(`
FROM busybox
VOLUME ["/tmp/data"]`))
cli.DockerCmd(c, "run", "--name=data1", image, "true")
cli.DockerCmd(c, "run", "--name=data2", image, "true")
cli.DockerCmd(c, "run", "--name=data1", imgName, "true")
cli.DockerCmd(c, "run", "--name=data2", imgName, "true")
data1 := cli.DockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1").Stdout()
data1 = strings.TrimSpace(data1)
@@ -510,13 +510,13 @@ func (s *DockerCLIVolumeSuite) TestDuplicateMountpointsForVolumesFrom(c *testing
func (s *DockerCLIVolumeSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *testing.T) {
testRequires(c, DaemonIsLinux)
const image = "vimage"
buildImageSuccessfully(c, image, build.WithDockerfile(`
const imgName = "vimage"
buildImageSuccessfully(c, imgName, build.WithDockerfile(`
FROM busybox
VOLUME ["/tmp/data"]`))
cli.DockerCmd(c, "run", "--name=data1", image, "true")
cli.DockerCmd(c, "run", "--name=data2", image, "true")
cli.DockerCmd(c, "run", "--name=data1", imgName, "true")
cli.DockerCmd(c, "run", "--name=data2", imgName, "true")
data1 := cli.DockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1").Stdout()
data1 = strings.TrimSpace(data1)
@@ -552,13 +552,13 @@ func (s *DockerCLIVolumeSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *
func (s *DockerCLIVolumeSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *testing.T) {
testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
const image = "vimage"
buildImageSuccessfully(c, image, build.WithDockerfile(`
const imgName = "vimage"
buildImageSuccessfully(c, imgName, build.WithDockerfile(`
FROM busybox
VOLUME ["/tmp/data"]`))
cli.DockerCmd(c, "run", "--name=data1", image, "true")
cli.DockerCmd(c, "run", "--name=data2", image, "true")
cli.DockerCmd(c, "run", "--name=data1", imgName, "true")
cli.DockerCmd(c, "run", "--name=data2", imgName, "true")
data1 := cli.DockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1").Stdout()
data1 = strings.TrimSpace(data1)