Skip to content

Commit cb6a3b6

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

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pkg/controlplane/controller/crdregistration/crdregistration_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ func (c *crdRegistrationController) handleVersionUpdate(groupVersion schema.Grou
221221
Spec: v1.APIServiceSpec{
222222
Group: groupVersion.Group,
223223
Version: groupVersion.Version,
224-
GroupPriorityMinimum: 1000, // CRDs should have relatively low priority
225-
VersionPriority: 100, // CRDs will be sorted by kube-like versions like any other APIService with the same VersionPriority
224+
GroupPriorityMinimum: getGroupPriorityMin(groupVersion.Group), // CRDs should have relatively low priority
225+
VersionPriority: 100, // CRDs will be sorted by kube-like versions like any other APIService with the same VersionPriority
226226
},
227227
})
228228
return nil
Lines changed: 12 additions & 0 deletions
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)