Skip to content

Commit f16ed16

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#53019 from smarterclayton/register
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. 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`. OpenShift hit this while registering a new connect handler endpoint in an api group for an api that is aggregated. OpenShift should not be registering its API types into the core API group.
2 parents ca71268 + 0e4b20f commit f16ed16

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

staging/src/k8s.io/apiserver/pkg/endpoints/installer.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
316316
return nil, err
317317
}
318318
getOptionsInternalKind = getOptionsInternalKinds[0]
319-
versionedGetOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(getOptionsInternalKind.Kind))
319+
versionedGetOptions, err = a.group.Creater.New(a.group.GroupVersion.WithKind(getOptionsInternalKind.Kind))
320320
if err != nil {
321-
return nil, err
321+
versionedGetOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(getOptionsInternalKind.Kind))
322+
if err != nil {
323+
return nil, err
324+
}
322325
}
323326
isGetter = true
324327
}
@@ -347,9 +350,12 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
347350
}
348351

349352
connectOptionsInternalKind = connectOptionsInternalKinds[0]
350-
versionedConnectOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(connectOptionsInternalKind.Kind))
353+
versionedConnectOptions, err = a.group.Creater.New(a.group.GroupVersion.WithKind(connectOptionsInternalKind.Kind))
351354
if err != nil {
352-
return nil, err
355+
versionedConnectOptions, err = a.group.Creater.New(optionsExternalVersion.WithKind(connectOptionsInternalKind.Kind))
356+
if err != nil {
357+
return nil, err
358+
}
353359
}
354360
}
355361
}

0 commit comments

Comments
 (0)