mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove deprecated environment.DockerBasePath()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6415f1dcf5
commit
142b1f8bfb
6 changed files with 11 additions and 18 deletions
|
@ -1514,7 +1514,7 @@ func (s *DockerSuite) TestBuildContextCleanup(c *check.C) {
|
|||
testRequires(c, SameHostDaemon)
|
||||
|
||||
name := "testbuildcontextcleanup"
|
||||
entries, err := ioutil.ReadDir(filepath.Join(testEnv.DockerBasePath(), "tmp"))
|
||||
entries, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp"))
|
||||
if err != nil {
|
||||
c.Fatalf("failed to list contents of tmp dir: %s", err)
|
||||
}
|
||||
|
@ -1522,7 +1522,7 @@ func (s *DockerSuite) TestBuildContextCleanup(c *check.C) {
|
|||
buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+`
|
||||
ENTRYPOINT ["/bin/echo"]`))
|
||||
|
||||
entriesFinal, err := ioutil.ReadDir(filepath.Join(testEnv.DockerBasePath(), "tmp"))
|
||||
entriesFinal, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp"))
|
||||
if err != nil {
|
||||
c.Fatalf("failed to list contents of tmp dir: %s", err)
|
||||
}
|
||||
|
@ -1536,7 +1536,7 @@ func (s *DockerSuite) TestBuildContextCleanupFailedBuild(c *check.C) {
|
|||
testRequires(c, SameHostDaemon)
|
||||
|
||||
name := "testbuildcontextcleanup"
|
||||
entries, err := ioutil.ReadDir(filepath.Join(testEnv.DockerBasePath(), "tmp"))
|
||||
entries, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp"))
|
||||
if err != nil {
|
||||
c.Fatalf("failed to list contents of tmp dir: %s", err)
|
||||
}
|
||||
|
@ -1546,7 +1546,7 @@ func (s *DockerSuite) TestBuildContextCleanupFailedBuild(c *check.C) {
|
|||
ExitCode: 1,
|
||||
})
|
||||
|
||||
entriesFinal, err := ioutil.ReadDir(filepath.Join(testEnv.DockerBasePath(), "tmp"))
|
||||
entriesFinal, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp"))
|
||||
if err != nil {
|
||||
c.Fatalf("failed to list contents of tmp dir: %s", err)
|
||||
}
|
||||
|
|
|
@ -635,7 +635,7 @@ func (s *DockerRegistrySuite) TestPullFailsWithAlteredLayer(c *check.C) {
|
|||
// digest verification for the target layer digest.
|
||||
|
||||
// Remove distribution cache to force a re-pull of the blobs
|
||||
if err := os.RemoveAll(filepath.Join(testEnv.DockerBasePath(), "image", s.d.StorageDriver(), "distribution")); err != nil {
|
||||
if err := os.RemoveAll(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "image", s.d.StorageDriver(), "distribution")); err != nil {
|
||||
c.Fatalf("error clearing distribution cache: %v", err)
|
||||
}
|
||||
|
||||
|
@ -678,7 +678,7 @@ func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredLayer(c *check.C) {
|
|||
// digest verification for the target layer digest.
|
||||
|
||||
// Remove distribution cache to force a re-pull of the blobs
|
||||
if err := os.RemoveAll(filepath.Join(testEnv.DockerBasePath(), "image", s.d.StorageDriver(), "distribution")); err != nil {
|
||||
if err := os.RemoveAll(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "image", s.d.StorageDriver(), "distribution")); err != nil {
|
||||
c.Fatalf("error clearing distribution cache: %v", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ func (s *DockerSuite) TestCpCheckDestOwnership(c *check.C) {
|
|||
}
|
||||
|
||||
func getRootUIDGID() (int, int, error) {
|
||||
uidgid := strings.Split(filepath.Base(testEnv.DockerBasePath()), ".")
|
||||
uidgid := strings.Split(filepath.Base(testEnv.DaemonInfo.DockerRootDir), ".")
|
||||
if len(uidgid) == 1 {
|
||||
//user namespace remapping is not turned on; return 0
|
||||
return 0, 0, nil
|
||||
|
|
|
@ -55,7 +55,7 @@ func (ps *DockerPluginSuite) TestPluginBasicOps(c *check.C) {
|
|||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(out, checker.Contains, plugin)
|
||||
|
||||
_, err = os.Stat(filepath.Join(testEnv.DockerBasePath(), "plugins", id))
|
||||
_, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id))
|
||||
if !os.IsNotExist(err) {
|
||||
c.Fatal(err)
|
||||
}
|
||||
|
@ -506,14 +506,14 @@ func (s *DockerSuite) TestPluginUpgrade(c *check.C) {
|
|||
id := strings.TrimSpace(out)
|
||||
|
||||
// make sure "v2" does not exists
|
||||
_, err = os.Stat(filepath.Join(testEnv.DockerBasePath(), "plugins", id, "rootfs", "v2"))
|
||||
_, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id, "rootfs", "v2"))
|
||||
c.Assert(os.IsNotExist(err), checker.True, check.Commentf(out))
|
||||
|
||||
dockerCmd(c, "plugin", "disable", "-f", plugin)
|
||||
dockerCmd(c, "plugin", "upgrade", "--grant-all-permissions", "--skip-remote-check", plugin, pluginV2)
|
||||
|
||||
// make sure "v2" file exists
|
||||
_, err = os.Stat(filepath.Join(testEnv.DockerBasePath(), "plugins", id, "rootfs", "v2"))
|
||||
_, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id, "rootfs", "v2"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
dockerCmd(c, "plugin", "enable", plugin)
|
||||
|
|
|
@ -4232,7 +4232,7 @@ func (s *DockerSuite) TestRunCredentialSpecFailures(c *check.C) {
|
|||
func (s *DockerSuite) TestRunCredentialSpecWellFormed(c *check.C) {
|
||||
testRequires(c, DaemonIsWindows, SameHostDaemon)
|
||||
validCS := readFile(`fixtures\credentialspecs\valid.json`, c)
|
||||
writeFile(filepath.Join(testEnv.DockerBasePath(), `credentialspecs\valid.json`), validCS, c)
|
||||
writeFile(filepath.Join(testEnv.DaemonInfo.DockerRootDir, `credentialspecs\valid.json`), validCS, c)
|
||||
dockerCmd(c, "run", `--security-opt=credentialspec=file://valid.json`, "busybox", "true")
|
||||
}
|
||||
|
||||
|
|
|
@ -49,13 +49,6 @@ func New() (*Execution, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
// DockerBasePath is the base path of the docker folder (by default it is -/var/run/docker)
|
||||
// TODO: remove
|
||||
// Deprecated: use Execution.DaemonInfo.DockerRootDir
|
||||
func (e *Execution) DockerBasePath() string {
|
||||
return e.DaemonInfo.DockerRootDir
|
||||
}
|
||||
|
||||
// ExperimentalDaemon tell whether the main daemon has
|
||||
// experimental features enabled or not
|
||||
// Deprecated: use DaemonInfo.ExperimentalBuild
|
||||
|
|
Loading…
Add table
Reference in a new issue