GC: Add check for nil interface

This commit is contained in:
Jordan Liggitt
2017-10-05 22:43:08 -04:00
parent fef3b03188
commit 34ed25cf52
2 changed files with 19 additions and 0 deletions

View File

@@ -128,6 +128,19 @@ func TestIsOnlyMutatingGCFields(t *testing.T) {
},
expected: false,
},
{
name: "and nil",
obj: func() runtime.Object {
obj := newPod()
obj.OwnerReferences = append(obj.OwnerReferences, metav1.OwnerReference{Name: "foo"})
obj.Spec.RestartPolicy = kapi.RestartPolicyAlways
return obj
},
old: func() runtime.Object {
return (*kapi.Pod)(nil)
},
expected: false,
},
}
for _, tc := range tests {