Skip to content

Commit

Permalink
UPSTREAM: <carry>: kube-apiserver: priorize some CRD groups over others
Browse files Browse the repository at this point in the history
OpenShift-Rebase-Source: 2260f01
  • Loading branch information
deads2k authored and dinhxuanvu committed Apr 15, 2024
1 parent c9356e4 commit 3d15b80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions pkg/controlplane/controller/crdregistration/patch.go
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 3d15b80

Please sign in to comment.