mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user