mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
70 lines
4.2 KiB
Go
70 lines
4.2 KiB
Go
/*
|
|
Copyright 2024 The Kubernetes Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package apiserver
|
|
|
|
import (
|
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
|
)
|
|
|
|
// APIServicePriority defines group priority that is used in discovery. This controls
|
|
// group position in the kubectl output.
|
|
type APIServicePriority struct {
|
|
// Group indicates the order of the group relative to other groups.
|
|
Group int32
|
|
// Version indicates the relative order of the Version inside of its group.
|
|
Version int32
|
|
}
|
|
|
|
// DefaultGenericAPIServicePriorities returns the APIService priorities for generic APIs
|
|
func DefaultGenericAPIServicePriorities() map[schema.GroupVersion]APIServicePriority {
|
|
// The proper way to resolve this letting the aggregator know the desired group and version-within-group order of the underlying servers
|
|
// is to refactor the genericapiserver.DelegationTarget to include a list of priorities based on which APIs were installed.
|
|
// This requires the APIGroupInfo struct to evolve and include the concept of priorities and to avoid mistakes, the core storage map there needs to be updated.
|
|
// That ripples out every bit as far as you'd expect, so for 1.7 we'll include the list here instead of being built up during storage.
|
|
return map[schema.GroupVersion]APIServicePriority{
|
|
{Group: "", Version: "v1"}: {Group: 18000, Version: 1},
|
|
// to my knowledge, nothing below here collides
|
|
{Group: "events.k8s.io", Version: "v1"}: {Group: 17750, Version: 15},
|
|
{Group: "events.k8s.io", Version: "v1beta1"}: {Group: 17750, Version: 5},
|
|
{Group: "authentication.k8s.io", Version: "v1"}: {Group: 17700, Version: 15},
|
|
{Group: "authentication.k8s.io", Version: "v1beta1"}: {Group: 17700, Version: 9},
|
|
{Group: "authentication.k8s.io", Version: "v1alpha1"}: {Group: 17700, Version: 1},
|
|
{Group: "authorization.k8s.io", Version: "v1"}: {Group: 17600, Version: 15},
|
|
{Group: "certificates.k8s.io", Version: "v1"}: {Group: 17300, Version: 15},
|
|
{Group: "certificates.k8s.io", Version: "v1alpha1"}: {Group: 17300, Version: 1},
|
|
{Group: "rbac.authorization.k8s.io", Version: "v1"}: {Group: 17000, Version: 15},
|
|
{Group: "apiextensions.k8s.io", Version: "v1"}: {Group: 16700, Version: 15},
|
|
{Group: "admissionregistration.k8s.io", Version: "v1"}: {Group: 16700, Version: 15},
|
|
{Group: "admissionregistration.k8s.io", Version: "v1beta1"}: {Group: 16700, Version: 12},
|
|
{Group: "admissionregistration.k8s.io", Version: "v1alpha1"}: {Group: 16700, Version: 9},
|
|
{Group: "coordination.k8s.io", Version: "v1"}: {Group: 16500, Version: 15},
|
|
{Group: "discovery.k8s.io", Version: "v1"}: {Group: 16200, Version: 15},
|
|
{Group: "discovery.k8s.io", Version: "v1beta1"}: {Group: 16200, Version: 12},
|
|
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1"}: {Group: 16100, Version: 21},
|
|
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3"}: {Group: 16100, Version: 18},
|
|
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2"}: {Group: 16100, Version: 15},
|
|
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1"}: {Group: 16100, Version: 12},
|
|
{Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1"}: {Group: 16100, Version: 9},
|
|
{Group: "internal.apiserver.k8s.io", Version: "v1alpha1"}: {Group: 16000, Version: 9},
|
|
{Group: "resource.k8s.io", Version: "v1alpha2"}: {Group: 15900, Version: 9},
|
|
{Group: "storagemigration.k8s.io", Version: "v1alpha1"}: {Group: 15800, Version: 9},
|
|
// Append a new group to the end of the list if unsure.
|
|
// You can use min(existing group)-100 as the initial value for a group.
|
|
// Version can be set to 9 (to have space around) for a new group.
|
|
}
|
|
}
|