Переглянути джерело

Remove duplicate rootFSToAPIType

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Daniel Nephin 7 роки тому
батько
коміт
4ceea53b5e
3 змінених файлів з 12 додано та 24 видалено
  1. 0 12
      daemon/daemon_unix.go
  2. 0 12
      daemon/daemon_windows.go
  3. 12 0
      daemon/image_inspect.go

+ 0 - 12
daemon/daemon_unix.go

@@ -24,7 +24,6 @@ import (
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/daemon/config"
 	"github.com/docker/docker/daemon/config"
 	"github.com/docker/docker/daemon/initlayer"
 	"github.com/docker/docker/daemon/initlayer"
-	"github.com/docker/docker/image"
 	"github.com/docker/docker/opts"
 	"github.com/docker/docker/opts"
 	"github.com/docker/docker/pkg/containerfs"
 	"github.com/docker/docker/pkg/containerfs"
 	"github.com/docker/docker/pkg/idtools"
 	"github.com/docker/docker/pkg/idtools"
@@ -1360,17 +1359,6 @@ func (daemon *Daemon) setDefaultIsolation() error {
 	return nil
 	return nil
 }
 }
 
 
-func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
-	var layers []string
-	for _, l := range rootfs.DiffIDs {
-		layers = append(layers, l.String())
-	}
-	return types.RootFS{
-		Type:   rootfs.Type,
-		Layers: layers,
-	}
-}
-
 // setupDaemonProcess sets various settings for the daemon's process
 // setupDaemonProcess sets various settings for the daemon's process
 func setupDaemonProcess(config *config.Config) error {
 func setupDaemonProcess(config *config.Config) error {
 	// setup the daemons oom_score_adj
 	// setup the daemons oom_score_adj

+ 0 - 12
daemon/daemon_windows.go

@@ -11,7 +11,6 @@ import (
 	containertypes "github.com/docker/docker/api/types/container"
 	containertypes "github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/daemon/config"
 	"github.com/docker/docker/daemon/config"
-	"github.com/docker/docker/image"
 	"github.com/docker/docker/pkg/containerfs"
 	"github.com/docker/docker/pkg/containerfs"
 	"github.com/docker/docker/pkg/fileutils"
 	"github.com/docker/docker/pkg/fileutils"
 	"github.com/docker/docker/pkg/idtools"
 	"github.com/docker/docker/pkg/idtools"
@@ -629,17 +628,6 @@ func (daemon *Daemon) setDefaultIsolation() error {
 	return nil
 	return nil
 }
 }
 
 
-func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
-	var layers []string
-	for _, l := range rootfs.DiffIDs {
-		layers = append(layers, l.String())
-	}
-	return types.RootFS{
-		Type:   rootfs.Type,
-		Layers: layers,
-	}
-}
-
 func setupDaemonProcess(config *config.Config) error {
 func setupDaemonProcess(config *config.Config) error {
 	return nil
 	return nil
 }
 }

+ 12 - 0
daemon/image_inspect.go

@@ -5,6 +5,7 @@ import (
 
 
 	"github.com/docker/distribution/reference"
 	"github.com/docker/distribution/reference"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/image"
 	"github.com/docker/docker/layer"
 	"github.com/docker/docker/layer"
 	"github.com/docker/docker/pkg/system"
 	"github.com/docker/docker/pkg/system"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
@@ -90,3 +91,14 @@ func (daemon *Daemon) LookupImage(name string) (*types.ImageInspect, error) {
 
 
 	return imageInspect, nil
 	return imageInspect, nil
 }
 }
+
+func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
+	var layers []string
+	for _, l := range rootfs.DiffIDs {
+		layers = append(layers, l.String())
+	}
+	return types.RootFS{
+		Type:   rootfs.Type,
+		Layers: layers,
+	}
+}