diff --git a/pkg/api/ref_test.go b/pkg/api/ref_test.go index 4f716672e93..dbde7a01f9c 100644 --- a/pkg/api/ref_test.go +++ b/pkg/api/ref_test.go @@ -36,6 +36,14 @@ type ExtensionAPIObject struct { func (obj *ExtensionAPIObject) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } func TestGetReference(t *testing.T) { + + // when vendoring kube, if you don't force the set of registered versions (like this hack/test-go.sh does) + // then you run into trouble because the types aren't registered in the scheme by anything. This does the + // register manually to allow unit test execution + if _, err := Scheme.ObjectKind(&Pod{}); err != nil { + AddToScheme(Scheme) + } + table := map[string]struct { obj runtime.Object ref *ObjectReference