mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Remove logic to handle if UID is blank
This should only have been triggered by tests, and those should now be fixed. I tested by calling panic() if UID was blank in BuildDockerName() or if number of fields was < 5 in ParseDockerName(). All errors were fixed.
This commit is contained in:
@@ -69,12 +69,12 @@ func TestRunOnce(t *testing.T) {
|
||||
kb := &Kubelet{}
|
||||
podContainers := []docker.APIContainers{
|
||||
{
|
||||
Names: []string{"/k8s_bar." + strconv.FormatUint(dockertools.HashContainer(&api.Container{Name: "bar"}), 16) + "_foo.new.test"},
|
||||
Names: []string{"/k8s_bar." + strconv.FormatUint(dockertools.HashContainer(&api.Container{Name: "bar"}), 16) + "_foo.new.test_12345678_42"},
|
||||
ID: "1234",
|
||||
Status: "running",
|
||||
},
|
||||
{
|
||||
Names: []string{"/k8s_net_foo.new.test_"},
|
||||
Names: []string{"/k8s_net_foo.new.test_abcdefgh_42"},
|
||||
ID: "9876",
|
||||
Status: "running",
|
||||
},
|
||||
@@ -109,6 +109,7 @@ func TestRunOnce(t *testing.T) {
|
||||
results, err := kb.runOnce([]api.BoundPod{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
UID: "12345678",
|
||||
Name: "foo",
|
||||
Namespace: "new",
|
||||
Annotations: map[string]string{ConfigSourceAnnotationKey: "test"},
|
||||
|
||||
Reference in New Issue
Block a user