kubelet: Refactor GetDockerVersion().

Remove GetDockerServerVersion() from DockerContainerCommandRunner interface,
replaced with runtime.Version(). Also added Version type in runtime for version
comparision.
This commit is contained in:
Yifan Gu
2015-04-21 13:02:50 -07:00
parent b944049fe9
commit 611fb25926
8 changed files with 81 additions and 37 deletions

View File

@@ -129,10 +129,10 @@ func TestContainerManifestNaming(t *testing.T) {
}
}
func TestGetDockerServerVersion(t *testing.T) {
func TestVersion(t *testing.T) {
fakeDocker := &FakeDockerClient{VersionInfo: docker.Env{"Version=1.1.3", "ApiVersion=1.15"}}
runner := dockerContainerCommandRunner{fakeDocker}
version, err := runner.GetDockerServerVersion()
manager := &DockerManager{client: fakeDocker}
version, err := manager.Version()
if err != nil {
t.Errorf("got error while getting docker server version - %s", err)
}