mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 02:11:09 +00:00
Fix: update system spec to support Docker 17.03
This commit is contained in:
parent
8ca1d9f19b
commit
9fbbec1afc
@ -39,7 +39,7 @@ func (d *DockerValidator) Name() string {
|
||||
const (
|
||||
dockerEndpoint = "unix:///var/run/docker.sock"
|
||||
dockerConfigPrefix = "DOCKER_"
|
||||
maxDockerValidatedVersion = "1.12"
|
||||
maxDockerValidatedVersion = "17.03"
|
||||
)
|
||||
|
||||
// TODO(random-liu): Add more validating items.
|
||||
@ -71,8 +71,9 @@ func (d *DockerValidator) validateDockerInfo(spec *DockerSpec, info types.Info)
|
||||
}
|
||||
}
|
||||
if !matched {
|
||||
// catch if docker is 1.13+
|
||||
ver := `1\.(1[3-9])\..*|\d{2}\.\d+\.\d+-[a-z]{2}`
|
||||
// If it's of the new Docker version scheme but didn't match above, it
|
||||
// must be a newer version than the most recently validated one.
|
||||
ver := `\d{2}\.\d+\.\d+-[a-z]{2}`
|
||||
r := regexp.MustCompile(ver)
|
||||
if r.MatchString(info.ServerVersion) {
|
||||
d.Reporter.Report(dockerConfigPrefix+"VERSION", info.ServerVersion, good)
|
||||
|
@ -28,7 +28,7 @@ func TestValidateDockerInfo(t *testing.T) {
|
||||
Reporter: DefaultReporter,
|
||||
}
|
||||
spec := &DockerSpec{
|
||||
Version: []string{`1\.1[1-3]\..*`}, // Requires 1.11+
|
||||
Version: []string{`1\.1[1-3]\..*`, `17\.03\..*`}, // Requires [1.11, 17.03].
|
||||
GraphDriver: []string{"driver_1", "driver_2"},
|
||||
}
|
||||
for _, test := range []struct {
|
||||
@ -61,10 +61,14 @@ func TestValidateDockerInfo(t *testing.T) {
|
||||
err: false,
|
||||
warn: false,
|
||||
},
|
||||
// TODO remove/change warn value once sig-node supports 17.03-0-ce
|
||||
{
|
||||
info: types.Info{Driver: "driver_2", ServerVersion: "17.03.0-ce"},
|
||||
err: false,
|
||||
warn: false,
|
||||
},
|
||||
{
|
||||
info: types.Info{Driver: "driver_2", ServerVersion: "17.06.0-ce"},
|
||||
err: false,
|
||||
warn: true,
|
||||
},
|
||||
} {
|
||||
|
@ -159,7 +159,7 @@ var DefaultSysSpec = SysSpec{
|
||||
Cgroups: []string{"cpu", "cpuacct", "cpuset", "devices", "freezer", "memory"},
|
||||
RuntimeSpec: RuntimeSpec{
|
||||
DockerSpec: &DockerSpec{
|
||||
Version: []string{`1\.1[1-3]\..*`}, // Requires 1.11+
|
||||
Version: []string{`1\.1[1-3]\..*`, `17\.03\..*`}, // Requires [1.11, 17.03]
|
||||
GraphDriver: []string{"aufs", "overlay", "overlay2", "devicemapper"},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user