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:
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@@ -363,8 +363,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/rancher/docker-from-scratch",
|
"ImportPath": "github.com/rancher/docker-from-scratch",
|
||||||
"Comment": "v1.8.2-1-4-ge435c54",
|
"Comment": "v1.9.1-rc1",
|
||||||
"Rev": "e435c547350adb6b30a64ec1c072f27177b70288"
|
"Rev": "29561830fcace9eef5dbbfc4008474e5425d34eb"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/rancher/netconf",
|
"ImportPath": "github.com/rancher/netconf",
|
||||||
|
10
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/Godeps/Godeps.json
generated
vendored
10
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/Godeps/Godeps.json
generated
vendored
@@ -37,6 +37,16 @@
|
|||||||
"ImportPath": "github.com/ryanuber/go-glob",
|
"ImportPath": "github.com/ryanuber/go-glob",
|
||||||
"Rev": "0067a9abd927e50aed5190662702f81231413ae0"
|
"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",
|
"ImportPath": "github.com/vishvananda/netlink",
|
||||||
"Rev": "ea0402b9dbdee2126f48508a441835ddcabc7d1e"
|
"Rev": "ea0402b9dbdee2126f48508a441835ddcabc7d1e"
|
||||||
|
24
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scratch.go
generated
vendored
24
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scratch.go
generated
vendored
@@ -297,30 +297,16 @@ func setupNetworking(config *Config) error {
|
|||||||
return nil
|
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 {
|
func ParseConfig(config *Config, args ...string) []string {
|
||||||
for i, arg := range args {
|
for i, arg := range args {
|
||||||
if strings.HasPrefix(arg, "--bip") {
|
if strings.HasPrefix(arg, "--bip") {
|
||||||
config.BridgeAddress = getValue(i, args)
|
config.BridgeAddress = util.GetValue(i, args)
|
||||||
} else if strings.HasPrefix(arg, "--fixed-cidr") {
|
} 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") {
|
} 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") {
|
} else if strings.HasPrefix(arg, "--mtu") {
|
||||||
mtu, err := strconv.Atoi(getValue(i, args))
|
mtu, err := strconv.Atoi(util.GetValue(i, args))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
config.BridgeMtu = mtu
|
config.BridgeMtu = mtu
|
||||||
}
|
}
|
||||||
@@ -380,7 +366,7 @@ func touchSockets(args ...string) error {
|
|||||||
|
|
||||||
for i, arg := range args {
|
for i, arg := range args {
|
||||||
if strings.HasPrefix(arg, "-H") {
|
if strings.HasPrefix(arg, "-H") {
|
||||||
val := getValue(i, args)
|
val := util.GetValue(i, args)
|
||||||
if strings.HasPrefix(val, "unix://") {
|
if strings.HasPrefix(val, "unix://") {
|
||||||
val = val[len("unix://"):]
|
val = val[len("unix://"):]
|
||||||
log.Debugf("Creating temp file at %s", val)
|
log.Debugf("Creating temp file at %s", val)
|
||||||
|
@@ -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/mitchellh/gox
|
||||||
RUN go get github.com/tools/godep
|
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
2
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scripts/download
generated
vendored
Normal file → Executable file
@@ -47,7 +47,7 @@ else
|
|||||||
cp assets/base-files.tar.gz build
|
cp assets/base-files.tar.gz build
|
||||||
fi
|
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
|
cp assets/docker-* build/docker
|
||||||
chmod +x build/docker
|
chmod +x build/docker
|
||||||
|
2
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scripts/version
generated
vendored
2
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/scripts/version
generated
vendored
@@ -1 +1 @@
|
|||||||
1.8.2
|
1.9.1-rc1
|
||||||
|
19
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/util/util.go
generated
vendored
Normal file
19
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/util/util.go
generated
vendored
Normal 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]
|
||||||
|
}
|
||||||
|
}
|
20
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/util/util_test.go
generated
vendored
Normal file
20
Godeps/_workspace/src/github.com/rancher/docker-from-scratch/util/util_test.go
generated
vendored
Normal 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))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user