diff --git a/pkg/master/master_test.go b/pkg/master/master_test.go index d3712417ebc..dcc58bbd195 100644 --- a/pkg/master/master_test.go +++ b/pkg/master/master_test.go @@ -107,7 +107,7 @@ func initThirdParty(t *testing.T) (*tools.FakeEtcdClient, *httptest.Server) { Versions: []expapi.APIVersion{ { APIGroup: "group", - Name: "v1", + Name: "v3", }, }, } diff --git a/pkg/registry/thirdpartyresourcedata/codec.go b/pkg/registry/thirdpartyresourcedata/codec.go index 7d2c75bb0be..1d9dbc1b6d2 100644 --- a/pkg/registry/thirdpartyresourcedata/codec.go +++ b/pkg/registry/thirdpartyresourcedata/codec.go @@ -98,7 +98,15 @@ func (t *thirdPartyResourceDataCodec) populate(objIn *expapi.ThirdPartyResourceD if !ok { return fmt.Errorf("unexpected object: %#v", obj) } - + + if resourceVersion, ok := metadata["resourceVersion"]; ok { + resourceVersionStr, ok := resourceVersion.(string) + if !ok { + return fmt.Errorf("unexpected object: %v", metadata["resourceVersion"]) + } + objIn.ResourceVersion = strconv.Atoi(resourceVersionStr) + } + objIn.Name = name objIn.Data = data return nil