From d1431e49e478e40259e7613895e48e6d7a1a2d7e Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Mon, 25 Sep 2017 17:03:34 -0400 Subject: [PATCH] Endpoints can add a get or connect options type in their group optionsExternalVersion is being used for shared types (meta.k8s.io). The installer should first look in the current API group for GET and CONNECT options objects before checking in `v1`. Kubernetes-commit: 0e4b20fbf9ff299c37a5055e082fa27dbf2b49c0 --- pkg/endpoints/installer.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/endpoints/installer.go b/pkg/endpoints/installer.go index 08fb27108..7e5434ef0 100644 --- a/pkg/endpoints/installer.go +++ b/pkg/endpoints/installer.go @@ -316,9 +316,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag return nil, err } getOptionsInternalKind = getOptionsInternalKinds[0] - versionedGetOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(getOptionsInternalKind.Kind)) + versionedGetOptions, err = a.group.Creater.New(a.group.GroupVersion.WithKind(getOptionsInternalKind.Kind)) if err != nil { - return nil, err + versionedGetOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(getOptionsInternalKind.Kind)) + if err != nil { + return nil, err + } } isGetter = true } @@ -347,9 +350,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag } connectOptionsInternalKind = connectOptionsInternalKinds[0] - versionedConnectOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(connectOptionsInternalKind.Kind)) + versionedConnectOptions, err = a.group.Creater.New(a.group.GroupVersion.WithKind(connectOptionsInternalKind.Kind)) if err != nil { - return nil, err + versionedConnectOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(connectOptionsInternalKind.Kind)) + if err != nil { + return nil, err + } } } }