checkVersionCompatibility verifies whether docker is in a compatible version.
()
| 458 | |
| 459 | // checkVersionCompatibility verifies whether docker is in a compatible version. |
| 460 | func (ds *dockerService) checkVersionCompatibility() error { |
| 461 | apiVersion, err := ds.getDockerAPIVersion() |
| 462 | if err != nil { |
| 463 | return err |
| 464 | } |
| 465 | |
| 466 | minAPIVersion, err := semver.Parse(libdocker.MinimumDockerAPIVersion) |
| 467 | if err != nil { |
| 468 | return err |
| 469 | } |
| 470 | |
| 471 | // Verify the docker version. |
| 472 | result := apiVersion.Compare(minAPIVersion) |
| 473 | if result < 0 { |
| 474 | return fmt.Errorf("docker API version is older than %s", libdocker.MinimumDockerAPIVersion) |
| 475 | } |
| 476 | |
| 477 | return nil |
| 478 | } |
| 479 | |
| 480 | // initCleanup is responsible for cleaning up any crufts left by previous |
| 481 | // runs. If there are any errors, it simply logs them. |
no test coverage detected