Skip to content

Commit

Permalink
fix: use correct GVK when discovering resources
Browse files Browse the repository at this point in the history
The assignment of GroupVersion as Group results in invalid request URIs
with a duplicate version element, resulting in 404s.

(cherry picked from commit 8f87f0e)
  • Loading branch information
valorl authored and alekc committed Jul 19, 2023
1 parent fbed0bd commit 09608ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kubernetes/resource_kubectl_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,9 @@ func checkAPIResourceIsPresent(available []*meta_v1.APIResourceList, resource me
group := rList.GroupVersion
for _, r := range rList.APIResources {
if group == resource.GroupVersionKind().GroupVersion().String() && r.Kind == resource.GetKind() {
r.Group = rList.GroupVersion
r.Kind = rList.Kind
r.Group = resource.GroupVersionKind().Group
r.Version = resource.GroupVersionKind().Version
r.Kind = resource.GroupVersionKind().Kind
return &r, true
}
}
Expand Down

0 comments on commit 09608ee

Please sign in to comment.