Use strong type for container ID

Change all references to the container ID in pkg/kubelet/... to the
strong type defined in pkg/kubelet/container: ContainerID

The motivation for this change is to make the format of the ID
unambiguous, specifically whether or not it includes the runtime
prefix (e.g. "docker://").
This commit is contained in:
Tim St. Clair
2015-10-07 10:58:05 -07:00
parent 092dddd12c
commit 551eff63b8
27 changed files with 228 additions and 211 deletions

View File

@@ -22,7 +22,6 @@ import (
docker "github.com/fsouza/go-dockerclient"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/types"
)
func TestToRuntimeContainer(t *testing.T) {
@@ -33,7 +32,7 @@ func TestToRuntimeContainer(t *testing.T) {
Names: []string{"/k8s_bar.5678_foo_ns_1234_42"},
}
expected := &kubecontainer.Container{
ID: types.UID("ab2cdf"),
ID: kubecontainer.ContainerID{"docker", "ab2cdf"},
Name: "bar",
Image: "bar_image",
Hash: 0x5678,