Skip to content

Commit

Permalink
Skip sorting if regex mismatch. (#355)
Browse files Browse the repository at this point in the history
Signed-off-by: Rokibul Hasan <[email protected]>
  • Loading branch information
RokibulHasan7 authored and tamalsaha committed Dec 30, 2024
1 parent 26fde2a commit 07bf4d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controllers/projectquota/projectquota_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ func (r *ProjectQuotaReconciler) ListKinds() (map[string]APIType, error) {

for gk, x := range apiTypes {
if len(x.Versions) > 1 {
if _, err := apiversion.NewVersion(x.Versions[0]); err != nil {
continue
}
sort.Slice(x.Versions, func(i, j int) bool {
return apiversion.MustCompare(x.Versions[i], x.Versions[j]) > 0
})
Expand Down

0 comments on commit 07bf4d6

Please sign in to comment.