Forráskód Böngészése

remove dead code

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Jessica Frazelle 9 éve
szülő
commit
8dd88afb5b

+ 0 - 16
api/client/build.go

@@ -286,22 +286,6 @@ func validateTag(rawRepo string) (string, error) {
 	return rawRepo, nil
 	return rawRepo, nil
 }
 }
 
 
-// writeToFile copies from the given reader and writes it to a file with the
-// given filename.
-func writeToFile(r io.Reader, filename string) error {
-	file, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.FileMode(0600))
-	if err != nil {
-		return fmt.Errorf("unable to create file: %v", err)
-	}
-	defer file.Close()
-
-	if _, err := io.Copy(file, r); err != nil {
-		return fmt.Errorf("unable to write file: %v", err)
-	}
-
-	return nil
-}
-
 var dockerfileFromLinePattern = regexp.MustCompile(`(?i)^[\s]*FROM[ \f\r\t\v]+(?P<image>[^ \f\r\t\v\n#]+)`)
 var dockerfileFromLinePattern = regexp.MustCompile(`(?i)^[\s]*FROM[ \f\r\t\v]+(?P<image>[^ \f\r\t\v\n#]+)`)
 
 
 // resolvedTag records the repository, tag, and resolved digest reference
 // resolvedTag records the repository, tag, and resolved digest reference

+ 0 - 5
builder/dockerfile/dispatchers.go

@@ -27,11 +27,6 @@ import (
 	"github.com/docker/go-connections/nat"
 	"github.com/docker/go-connections/nat"
 )
 )
 
 
-// dispatch with no layer / parsing. This is effectively not a command.
-func nullDispatch(b *Builder, args []string, attributes map[string]bool, original string) error {
-	return nil
-}
-
 // ENV foo bar
 // ENV foo bar
 //
 //
 // Sets the environment variable foo to bar, also makes interpolation
 // Sets the environment variable foo to bar, also makes interpolation

+ 0 - 1
daemon/config_unix.go

@@ -14,7 +14,6 @@ import (
 var (
 var (
 	defaultPidFile = "/var/run/docker.pid"
 	defaultPidFile = "/var/run/docker.pid"
 	defaultGraph   = "/var/lib/docker"
 	defaultGraph   = "/var/lib/docker"
-	defaultExec    = "native"
 )
 )
 
 
 // Config defines the configuration of a docker daemon.
 // Config defines the configuration of a docker daemon.

+ 0 - 1
daemon/config_windows.go

@@ -9,7 +9,6 @@ import (
 var (
 var (
 	defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
 	defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
 	defaultGraph   = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
 	defaultGraph   = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
-	defaultExec    = "windows"
 )
 )
 
 
 // bridgeConfig stores all the bridge driver specific
 // bridgeConfig stores all the bridge driver specific

+ 0 - 5
daemon/execdriver/native/init.go

@@ -38,8 +38,3 @@ func initializer() {
 
 
 	panic("unreachable")
 	panic("unreachable")
 }
 }
-
-func writeError(err error) {
-	fmt.Fprint(os.Stderr, err)
-	os.Exit(1)
-}

+ 0 - 4
daemon/execdriver/windows/run.go

@@ -36,10 +36,6 @@ type layer struct {
 	Path string
 	Path string
 }
 }
 
 
-type defConfig struct {
-	DefFile string
-}
-
 type portBinding struct {
 type portBinding struct {
 	Protocol     string
 	Protocol     string
 	InternalPort int
 	InternalPort int

+ 0 - 11
daemon/info.go

@@ -3,7 +3,6 @@ package daemon
 import (
 import (
 	"os"
 	"os"
 	"runtime"
 	"runtime"
-	"strings"
 	"sync/atomic"
 	"sync/atomic"
 	"time"
 	"time"
 
 
@@ -163,13 +162,3 @@ func (daemon *Daemon) showPluginsInfo() types.PluginsInfo {
 
 
 	return pluginsInfo
 	return pluginsInfo
 }
 }
-
-// The uppercase and the lowercase are available for the proxy settings.
-// See the Go specification for details on these variables. https://golang.org/pkg/net/http/
-func getProxyEnv(key string) string {
-	proxyValue := os.Getenv(strings.ToUpper(key))
-	if proxyValue == "" {
-		return os.Getenv(strings.ToLower(key))
-	}
-	return proxyValue
-}

+ 4 - 6
daemon/logger/fluentd/fluentd.go

@@ -24,12 +24,10 @@ type fluentd struct {
 }
 }
 
 
 const (
 const (
-	name                             = "fluentd"
-	defaultHostName                  = "localhost"
-	defaultPort                      = 24224
-	defaultTagPrefix                 = "docker"
-	defaultIgnoreConnectErrorOnStart = false           // So that we do not break existing behaviour
-	defaultBufferLimit               = 1 * 1024 * 1024 // 1M buffer by default
+	name               = "fluentd"
+	defaultHostName    = "localhost"
+	defaultPort        = 24224
+	defaultBufferLimit = 1 * 1024 * 1024 // 1M buffer by default
 )
 )
 
 
 func init() {
 func init() {

+ 0 - 49
daemon/volumes_unix.go

@@ -10,8 +10,6 @@ import (
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/daemon/execdriver"
 	"github.com/docker/docker/daemon/execdriver"
 	"github.com/docker/docker/volume"
 	"github.com/docker/docker/volume"
-	volumedrivers "github.com/docker/docker/volume/drivers"
-	"github.com/docker/docker/volume/local"
 )
 )
 
 
 // setupMounts iterates through each of the mount points for a container and
 // setupMounts iterates through each of the mount points for a container and
@@ -70,53 +68,6 @@ func sortMounts(m []execdriver.Mount) []execdriver.Mount {
 	return m
 	return m
 }
 }
 
 
-// migrateVolume links the contents of a volume created pre Docker 1.7
-// into the location expected by the local driver.
-// It creates a symlink from DOCKER_ROOT/vfs/dir/VOLUME_ID to DOCKER_ROOT/volumes/VOLUME_ID/_container_data.
-// It preserves the volume json configuration generated pre Docker 1.7 to be able to
-// downgrade from Docker 1.7 to Docker 1.6 without losing volume compatibility.
-func migrateVolume(id, vfs string) error {
-	l, err := volumedrivers.Lookup(volume.DefaultDriverName)
-	if err != nil {
-		return err
-	}
-
-	newDataPath := l.(*local.Root).DataPath(id)
-	fi, err := os.Stat(newDataPath)
-	if err != nil && !os.IsNotExist(err) {
-		return err
-	}
-
-	if fi != nil && fi.IsDir() {
-		return nil
-	}
-
-	return os.Symlink(vfs, newDataPath)
-}
-
-// validVolumeLayout checks whether the volume directory layout
-// is valid to work with Docker post 1.7 or not.
-func validVolumeLayout(files []os.FileInfo) bool {
-	if len(files) == 1 && files[0].Name() == local.VolumeDataPathName && files[0].IsDir() {
-		return true
-	}
-
-	if len(files) != 2 {
-		return false
-	}
-
-	for _, f := range files {
-		if f.Name() == "config.json" ||
-			(f.Name() == local.VolumeDataPathName && f.Mode()&os.ModeSymlink == os.ModeSymlink) {
-			// Old volume configuration, we ignore it
-			continue
-		}
-		return false
-	}
-
-	return true
-}
-
 // setBindModeIfNull is platform specific processing to ensure the
 // setBindModeIfNull is platform specific processing to ensure the
 // shared mode is set to 'z' if it is null. This is called in the case
 // shared mode is set to 'z' if it is null. This is called in the case
 // of processing a named volume and not a typical bind.
 // of processing a named volume and not a typical bind.