mirror of
https://github.com/rancher/os.git
synced 2025-07-16 08:05:51 +00:00
Merge pull request #650 from imikushin/update-dfs
update vendored docker-from-scratch to 1.9.1-rc1
This commit is contained in:
commit
6d39772ade
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -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",
|
||||
|
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",
|
||||
"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"
|
||||
|
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
|
||||
}
|
||||
|
||||
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)
|
||||
|
@ -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
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
|
||||
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
|
||||
|
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))
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ rancher:
|
||||
gateway: 10.10.2.2
|
||||
mtu: 1500
|
||||
docker:
|
||||
args: [daemon, --log-opt, max-file=2, --log-opt, max-size=25m, -s, overlay, -G, docker, -H, 'unix:///var/run/docker.sock', -H, 'tcp://0.0.0.0:2375', --userland-proxy=false]
|
||||
args: [daemon, --log-opt, max-file=2, --log-opt, max-size=25m, -s, overlay, -G, docker, -H, 'unix:///var/run/docker.sock', --userland-proxy=false]
|
||||
tls_args: [--tlsverify, --tlscacert=/home/rancher/.docker/ca.pem, --tlscert=/home/rancher/.docker/server-cert.pem, --tlskey=/home/rancher/.docker/server-key.pem, '-H=0.0.0.0:2376']
|
||||
ssh_authorized_keys:
|
||||
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUlsWAL5Rf0Wis/A7k7Tlqx0fZS60VzCZrPZYbP/wkL95jv0XzCx8bd1rZHeybblHPDNpND3BLv4qPY5DxRyexF4seGuzcJI/pOvGUGjQondeMPgDTFEo5w939gSdeTZcfXzQ0wAVhzwDbgH4zPfMzbdoo8Aiu9jkKljXw8IFju0gh+t6iKkGZCIjKT9o7zza1vGfkodhvi2V3VzPdNO28gaxZaRNtmBYUoVnGyR6nXN1Q3CJaVuh5o6GPCOqrhHNbYOFZKBpDiHbxPhVpxHQD2+8yUSGTG7WW75FfZePja5y8d0c/O5L37ZYx4AZAd3KgQYDBT2XCEJGQNawNbfpt
|
||||
|
@ -53,6 +53,33 @@ def test_docker_args(qemu, cloud_config):
|
||||
assert v.find(expected) != -1
|
||||
|
||||
|
||||
@pytest.mark.timeout(40)
|
||||
def test_docker_tls_args(qemu, cloud_config):
|
||||
assert qemu is not None
|
||||
u.wait_for_ssh(ssh_command)
|
||||
|
||||
subprocess.check_call(
|
||||
ssh_command + ['sudo', 'ros', 'tls', 'generate', '-s', '--hostname', '10.10.2.120', '-d', '~/.docker'],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
|
||||
subprocess.check_call(
|
||||
ssh_command + ['sudo', 'ros', 'config', 'set', 'rancher.docker.tls', 'true'],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
|
||||
subprocess.check_call(
|
||||
ssh_command + ['sudo', 'system-docker', 'restart', 'docker'],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
u.wait_for_ssh(ssh_command)
|
||||
|
||||
v = subprocess.check_output(
|
||||
ssh_command + ['sh', '-c', 'ps -ef | grep docker'],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
|
||||
expected = string.join(cloud_config['rancher']['docker']['tls_args'])
|
||||
|
||||
assert v.find(expected) != -1
|
||||
|
||||
|
||||
@pytest.mark.timeout(40)
|
||||
def test_rancher_network(qemu, cloud_config):
|
||||
assert qemu is not None
|
||||
|
Loading…
Reference in New Issue
Block a user