mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Merge pull request #118093 from Icarus9913/fix/wk/apiserver
fix apiserver InstallAPIGroups slices out of range
This commit is contained in:
commit
6d09ab86c2
@ -836,6 +836,9 @@ func (s *GenericAPIServer) InstallLegacyAPIGroup(apiPrefix string, apiGroupInfo
|
||||
// underlying storage will be destroyed on this servers shutdown.
|
||||
func (s *GenericAPIServer) InstallAPIGroups(apiGroupInfos ...*APIGroupInfo) error {
|
||||
for _, apiGroupInfo := range apiGroupInfos {
|
||||
if len(apiGroupInfo.PrioritizedVersions) == 0 {
|
||||
return fmt.Errorf("no version priority set for %#v", *apiGroupInfo)
|
||||
}
|
||||
// Do not register empty group or empty version. Doing so claims /apis/ for the wrong entity to be returned.
|
||||
// Catching these here places the error much closer to its origin
|
||||
if len(apiGroupInfo.PrioritizedVersions[0].Group) == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user