MCPcopy Create free account
hub / github.com/Mirantis/cri-dockerd / checkVersionCompatibility

Method checkVersionCompatibility

core/docker_service.go:460–478  ·  view source on GitHub ↗

checkVersionCompatibility verifies whether docker is in a compatible version.

()

Source from the content-addressed store, hash-verified

458
459// checkVersionCompatibility verifies whether docker is in a compatible version.
460func (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.

Callers 1

NewDockerServiceFunction · 0.95

Calls 1

getDockerAPIVersionMethod · 0.95

Tested by

no test coverage detected