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`.
parent e381a737
...@@ -316,10 +316,13 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag ...@@ -316,10 +316,13 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
return nil, err return nil, err
} }
getOptionsInternalKind = getOptionsInternalKinds[0] getOptionsInternalKind = getOptionsInternalKinds[0]
versionedGetOptions, err = a.group.Creater.New(a.group.GroupVersion.WithKind(getOptionsInternalKind.Kind))
if err != nil {
versionedGetOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(getOptionsInternalKind.Kind)) versionedGetOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(getOptionsInternalKind.Kind))
if err != nil { if err != nil {
return nil, err return nil, err
} }
}
isGetter = true isGetter = true
} }
...@@ -347,12 +350,15 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag ...@@ -347,12 +350,15 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
} }
connectOptionsInternalKind = connectOptionsInternalKinds[0] connectOptionsInternalKind = connectOptionsInternalKinds[0]
versionedConnectOptions, err = a.group.Creater.New(a.group.GroupVersion.WithKind(connectOptionsInternalKind.Kind))
if err != nil {
versionedConnectOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(connectOptionsInternalKind.Kind)) versionedConnectOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(connectOptionsInternalKind.Kind))
if err != nil { if err != nil {
return nil, err return nil, err
} }
} }
} }
}
var ctxFn handlers.ContextFunc var ctxFn handlers.ContextFunc
ctxFn = func(req *http.Request) request.Context { ctxFn = func(req *http.Request) request.Context {
......
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