Merge pull request #71001 from Deepomatic/recognize_docker_1809_version

Recognize newer docker versions without -ce/-ee suffix: 18.09.0
pull/58/head
k8s-ci-robot 2018-11-13 14:59:36 -08:00 committed by GitHub
commit 48d788de6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,7 @@ func (d *DockerValidator) validateDockerInfo(spec *DockerSpec, info types.Info)
if !matched {
// 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}`
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)

View File

@ -81,6 +81,11 @@ func TestValidateDockerInfo(t *testing.T) {
err: false,
warn: false,
},
{
info: types.Info{Driver: "driver_2", ServerVersion: "18.09.0"},
err: false,
warn: true,
},
} {
warn, err := v.validateDockerInfo(spec, test.info)
if !test.err {