Unverified Commit 48d788de authored by k8s-ci-robot's avatar k8s-ci-robot Committed by GitHub

Merge pull request #71001 from Deepomatic/recognize_docker_1809_version

Recognize newer docker versions without -ce/-ee suffix: 18.09.0
parents bc6aee19 068cdaa5
...@@ -73,7 +73,7 @@ func (d *DockerValidator) validateDockerInfo(spec *DockerSpec, info types.Info) ...@@ -73,7 +73,7 @@ func (d *DockerValidator) validateDockerInfo(spec *DockerSpec, info types.Info)
if !matched { if !matched {
// If it's of the new Docker version scheme but didn't match above, it // 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. // must be a newer version than the most recently validated one.
ver := `\d{2}\.\d+\.\d+-[a-z]{2}` ver := `\d{2}\.\d+\.\d+(?:-[a-z]{2})?`
r := regexp.MustCompile(ver) r := regexp.MustCompile(ver)
if r.MatchString(info.ServerVersion) { if r.MatchString(info.ServerVersion) {
d.Reporter.Report(dockerConfigPrefix+"VERSION", info.ServerVersion, good) d.Reporter.Report(dockerConfigPrefix+"VERSION", info.ServerVersion, good)
......
...@@ -81,6 +81,11 @@ func TestValidateDockerInfo(t *testing.T) { ...@@ -81,6 +81,11 @@ func TestValidateDockerInfo(t *testing.T) {
err: false, err: false,
warn: false, warn: false,
}, },
{
info: types.Info{Driver: "driver_2", ServerVersion: "18.09.0"},
err: false,
warn: true,
},
} { } {
warn, err := v.validateDockerInfo(spec, test.info) warn, err := v.validateDockerInfo(spec, test.info)
if !test.err { if !test.err {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment