Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register internal types with scheme for reference unit test #22913

Merged
merged 1 commit into from
Mar 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/api/ref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down