From a9cf1354c1f85d6fcee84aef327ac125a4d21347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ellen=20K=C3=B6rbes?= Date: Mon, 5 Mar 2018 19:15:13 -0300 Subject: [PATCH] rebase --- pkg/framework/resource/parse.go | 13 ++++++++----- pkg/framework/resource/resource.go | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pkg/framework/resource/parse.go b/pkg/framework/resource/parse.go index 9a00ec169..f4ac239ec 100644 --- a/pkg/framework/resource/parse.go +++ b/pkg/framework/resource/parse.go @@ -149,7 +149,10 @@ func (p *parser) isGroupVersionMatch(group, version string) bool { // getOpenAPI retrieves a schema object from the API based on a // GroupVersionResource triplet. func (p *parser) getOpenAPI(group, version, kind string) proto.Schema { - schema := p.resources.LookupResource(schema.GroupVersionKind{group, version, kind}) + schema := p.resources.LookupResource(schema.GroupVersionKind{ + Group: group, + Version: version, + Kind: kind}) if schema == nil { return nil } @@ -180,11 +183,11 @@ func (p *parser) indexResources(gvs []*v1.APIResourceList) (Resources, map[schem } newResource := &Resource{ Resource: r, - apiGroupVersion: schema.GroupVersion{group, version}, + apiGroupVersion: schema.GroupVersion{Group: group, Version: version}, schema: newSchema, } resources[name] = append(resources[name], newResource) - bygvr[schema.GroupVersionResource{group, version, r.Kind}] = newResource + bygvr[schema.GroupVersionResource{Group: group, Version: version, Resource: r.Kind}] = newResource } } return resources, bygvr @@ -214,7 +217,7 @@ func (p *parser) attachSubResources( continue } // Make sure the Parent resource wasn't filtered out - gvr := schema.GroupVersionResource{group, version, resourceName} + gvr := schema.GroupVersionResource{Group: group, Version: version, Resource: resourceName} if _, found := bygvr[gvr]; !found { continue } @@ -222,7 +225,7 @@ func (p *parser) attachSubResources( subRes := &SubResource{ Resource: r, parent: parent, - apiGroupVersion: schema.GroupVersion{group, version}, + apiGroupVersion: schema.GroupVersion{Group: group, Version: version}, schema: newSchema, } parent.SubResources = append(parent.SubResources, subRes) diff --git a/pkg/framework/resource/resource.go b/pkg/framework/resource/resource.go index 764c0263a..cc5b0f461 100644 --- a/pkg/framework/resource/resource.go +++ b/pkg/framework/resource/resource.go @@ -52,10 +52,10 @@ func (sr *SubResource) EndpointGroupVersionKind() schema.GroupVersionKind { // ResourceGroupVersionKind returns a GVK based on the request object. func (r *Resource) ResourceGroupVersionKind() schema.GroupVersionKind { - return schema.GroupVersionKind{r.Resource.Group, r.Resource.Version, r.Resource.Kind} + return schema.GroupVersionKind{Group: r.Resource.Group, Version: r.Resource.Version, Kind: r.Resource.Kind} } // ResourceGroupVersionKind returns a GVK based on the request object. func (sr *SubResource) RequestGroupVersionKind() schema.GroupVersionKind { - return schema.GroupVersionKind{sr.Resource.Group, sr.Resource.Version, sr.Resource.Kind} + return schema.GroupVersionKind{Group: sr.Resource.Group, Version: sr.Resource.Version, Kind: sr.Resource.Kind} }