Skip to content

Commit f1a6edf

Browse files
deads2kbertinatto
authored andcommitted
UPSTREAM: <carry>: kube-apiserver: priorize some CRD groups over others
OpenShift-Rebase-Source: 2260f01
1 parent 3ea165c commit f1a6edf

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pkg/controlplane/controller/crdregistration/crdregistration_controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ func (c *crdRegistrationController) handleVersionUpdate(groupVersion schema.Grou
224224
Spec: v1.APIServiceSpec{
225225
Group: groupVersion.Group,
226226
Version: groupVersion.Version,
227-
GroupPriorityMinimum: 1000, // CRDs should have relatively low priority
228-
VersionPriority: 100, // CRDs will be sorted by kube-like versions like any other APIService with the same VersionPriority
227+
GroupPriorityMinimum: getGroupPriorityMin(groupVersion.Group), // CRDs should have relatively low priority
228+
VersionPriority: 100, // CRDs will be sorted by kube-like versions like any other APIService with the same VersionPriority
229229
},
230230
})
231231
return nil
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package crdregistration
2+
3+
func getGroupPriorityMin(group string) int32 {
4+
switch group {
5+
case "config.openshift.io":
6+
return 1100
7+
case "operator.openshift.io":
8+
return 1080
9+
default:
10+
return 1000
11+
}
12+
}

0 commit comments

Comments
 (0)