mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Recognize newer docker versions without -ce/-ee suffix
Since docker 18.09, the ServerVersion field format changed: the `-ce` or `-ee` suffix disappeared: - docker 18.06: `18.06.1-ce` - docker 18.09: `18.09.0` This was not expected by the docker_validator version regexp, which assumed newer docker versions ended with `-[a-z]{2}`. This made the validator return an error, whereas we expect it to return only a warning (by recognizing it as a newer but not yet supported docker version). This commit relax the version regexp to also recognize `18.09.0`. The docker validator now returns a warning, as tested.
This commit is contained in:
parent
9199025b24
commit
068cdaa56c
@ -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)
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user