Merge pull request #21273 from jfrazelle/remove-dead-code

remove dead code
This commit is contained in:
Alexander Morozov 2016-03-17 09:16:02 -07:00
commit 04c7d94c71
9 changed files with 4 additions and 98 deletions

View File

@ -287,22 +287,6 @@ func validateTag(rawRepo string) (string, error) {
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#]+)`)
// resolvedTag records the repository, tag, and resolved digest reference

View File

@ -27,11 +27,6 @@ import (
"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
//
// Sets the environment variable foo to bar, also makes interpolation

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,6 @@ package daemon
import (
"os"
"runtime"
"strings"
"sync/atomic"
"time"
@ -163,13 +162,3 @@ func (daemon *Daemon) showPluginsInfo() types.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
}

View File

@ -24,12 +24,10 @@ type fluentd struct {
}
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() {

View File

@ -10,8 +10,6 @@ import (
"github.com/docker/docker/container"
"github.com/docker/docker/daemon/execdriver"
"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
@ -70,53 +68,6 @@ func sortMounts(m []execdriver.Mount) []execdriver.Mount {
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
// 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.