From b4ff82f9f84c78e01de81c5a63e0d5720e78ecca Mon Sep 17 00:00:00 2001 From: David Eads Date: Thu, 29 Oct 2020 13:55:56 +0100 Subject: [PATCH] UPSTREAM: : kube-apiserver: priorize some CRD groups over others OpenShift-Rebase-Source: 2260f017b39 --- .../crdregistration/crdregistration_controller.go | 4 ++-- pkg/controlplane/controller/crdregistration/patch.go | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 pkg/controlplane/controller/crdregistration/patch.go diff --git a/pkg/controlplane/controller/crdregistration/crdregistration_controller.go b/pkg/controlplane/controller/crdregistration/crdregistration_controller.go index 988ad840902c..f5a76af7f9d3 100644 --- a/pkg/controlplane/controller/crdregistration/crdregistration_controller.go +++ b/pkg/controlplane/controller/crdregistration/crdregistration_controller.go @@ -221,8 +221,8 @@ func (c *crdRegistrationController) handleVersionUpdate(groupVersion schema.Grou Spec: v1.APIServiceSpec{ Group: groupVersion.Group, Version: groupVersion.Version, - GroupPriorityMinimum: 1000, // CRDs should have relatively low priority - VersionPriority: 100, // CRDs will be sorted by kube-like versions like any other APIService with the same VersionPriority + GroupPriorityMinimum: getGroupPriorityMin(groupVersion.Group), // CRDs should have relatively low priority + VersionPriority: 100, // CRDs will be sorted by kube-like versions like any other APIService with the same VersionPriority }, }) return nil diff --git a/pkg/controlplane/controller/crdregistration/patch.go b/pkg/controlplane/controller/crdregistration/patch.go new file mode 100644 index 000000000000..ea989b6e1ed0 --- /dev/null +++ b/pkg/controlplane/controller/crdregistration/patch.go @@ -0,0 +1,12 @@ +package crdregistration + +func getGroupPriorityMin(group string) int32 { + switch group { + case "config.openshift.io": + return 1100 + case "operator.openshift.io": + return 1080 + default: + return 1000 + } +}