Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Aug 14, 2024
1 parent 65e99b6 commit cb2dbaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions pkg/registry/core/genericresource/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,7 @@ func (r *Storage) List(ctx context.Context, options *internalversion.ListOptions
continue
}
gk := gvk.GroupKind()
if v, exists := gvks[gk]; exists {
if apiversion.MustCompare(v, gvk.Version) < 0 {
gvks[gk] = gvk.Version
}
} else {
if v, exists := gvks[gk]; !exists || apiversion.MustCompare(v, gvk.Version) < 0 {
gvks[gk] = gvk.Version
}
}
Expand Down
6 changes: 1 addition & 5 deletions pkg/registry/core/resourcesummary/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,7 @@ func (r *Storage) List(ctx context.Context, options *internalversion.ListOptions
continue
}
gk := gvk.GroupKind()
if v, exists := gvks[gk]; exists {
if apiversion.MustCompare(v, gvk.Version) < 0 {
gvks[gk] = gvk.Version
}
} else {
if v, exists := gvks[gk]; !exists || apiversion.MustCompare(v, gvk.Version) < 0 {
gvks[gk] = gvk.Version
}
}
Expand Down

0 comments on commit cb2dbaf

Please sign in to comment.