1
0
mirror of https://github.com/rancher/os.git synced 2025-09-19 17:38:30 +00:00

vendor docker-from-scratch-1.9.1-rc1

This commit is contained in:
Ivan Mikushin
2015-11-17 18:08:24 +05:00
parent 0e308f56c1
commit 7b86628c36
8 changed files with 59 additions and 24 deletions

4
Godeps/Godeps.json generated
View File

@@ -363,8 +363,8 @@
},
{
"ImportPath": "github.com/rancher/docker-from-scratch",
"Comment": "v1.8.2-1-4-ge435c54",
"Rev": "e435c547350adb6b30a64ec1c072f27177b70288"
"Comment": "v1.9.1-rc1",
"Rev": "29561830fcace9eef5dbbfc4008474e5425d34eb"
},
{
"ImportPath": "github.com/rancher/netconf",

View File

@@ -37,6 +37,16 @@
"ImportPath": "github.com/ryanuber/go-glob",
"Rev": "0067a9abd927e50aed5190662702f81231413ae0"
},
{
"ImportPath": "github.com/stretchr/testify/assert",
"Comment": "v1.0-17-g089c718",
"Rev": "089c7181b8c728499929ff09b62d3fdd8df8adff"
},
{
"ImportPath": "github.com/stretchr/testify/require",
"Comment": "v1.0-17-g089c718",
"Rev": "089c7181b8c728499929ff09b62d3fdd8df8adff"
},
{
"ImportPath": "github.com/vishvananda/netlink",
"Rev": "ea0402b9dbdee2126f48508a441835ddcabc7d1e"

View File

@@ -297,30 +297,16 @@ func setupNetworking(config *Config) error {
return nil
}
func getValue(index int, args []string) string {
val := args[index]
parts := strings.SplitN(val, "=", 2)
if len(parts) == 1 {
if len(args) > index+1 {
return args[index+1]
} else {
return ""
}
} else {
return parts[2]
}
}
func ParseConfig(config *Config, args ...string) []string {
for i, arg := range args {
if strings.HasPrefix(arg, "--bip") {
config.BridgeAddress = getValue(i, args)
config.BridgeAddress = util.GetValue(i, args)
} else if strings.HasPrefix(arg, "--fixed-cidr") {
config.BridgeAddress = getValue(i, args)
config.BridgeAddress = util.GetValue(i, args)
} else if strings.HasPrefix(arg, "-b") || strings.HasPrefix(arg, "--bridge") {
config.BridgeName = getValue(i, args)
config.BridgeName = util.GetValue(i, args)
} else if strings.HasPrefix(arg, "--mtu") {
mtu, err := strconv.Atoi(getValue(i, args))
mtu, err := strconv.Atoi(util.GetValue(i, args))
if err != nil {
config.BridgeMtu = mtu
}
@@ -380,7 +366,7 @@ func touchSockets(args ...string) error {
for i, arg := range args {
if strings.HasPrefix(arg, "-H") {
val := getValue(i, args)
val := util.GetValue(i, args)
if strings.HasPrefix(val, "unix://") {
val = val[len("unix://"):]
log.Debugf("Creating temp file at %s", val)

View File

@@ -1,4 +1,4 @@
FROM golang:1.4.2-cross
FROM golang:1.4.3-cross
RUN go get github.com/mitchellh/gox
RUN go get github.com/tools/godep

2
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scripts/download generated vendored Normal file → Executable file
View File

@@ -47,7 +47,7 @@ else
cp assets/base-files.tar.gz build
fi
download ad3618b980105d907aae7bba40ca3ababb7c3d6d https://get.docker.com/builds/Linux/x86_64/docker-1.8.2
download 9da1e4d4cac3b117bb0cd7da66201fe1fc9953ab https://test.docker.com/builds/Linux/x86_64/docker-1.9.1-rc1
cp assets/docker-* build/docker
chmod +x build/docker

View File

@@ -1 +1 @@
1.8.2
1.9.1-rc1

View File

@@ -0,0 +1,19 @@
package util
import (
"strings"
)
func GetValue(index int, args []string) string {
val := args[index]
parts := strings.SplitN(val, "=", 2)
if len(parts) == 1 {
if len(args) > index+1 {
return args[index+1]
} else {
return ""
}
} else {
return parts[1]
}
}

View File

@@ -0,0 +1,20 @@
package util
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestNoPanic(t *testing.T) {
assert := require.New(t)
args := []string{"daemon", "--log-opt", "max-size=25m", "--log-opt", "max-file=2", "-s", "overlay", "-G", "docker", "-H", "unix:///var/run/docker.sock", "--userland-proxy=false", "--tlsverify", "--tlscacert=ca.pem", "--tlscert=server-cert.pem", "--tlskey=server-key.pem", "-H=0.0.0.0:2376"}
for i, v := range args {
if v == "-H=0.0.0.0:2376" {
assert.Equal("0.0.0.0:2376", GetValue(i, args))
}
if v == "-H" {
assert.Equal("unix:///var/run/docker.sock", GetValue(i, args))
}
}
}