Commit 3594370c authored by Jordan Liggitt's avatar Jordan Liggitt

register internal types with scheme for reference unit test

parent c9250bba
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment