Skip to content

Commit

Permalink
Fix resourceKindMap.addResource() to not assume every Kind has an A…
Browse files Browse the repository at this point in the history
…PIGroup (#805)

This was causing the `ResourceProvider.Resources` map to essentially
loose resources with no APIGroup, such as ServiceAccounts.
  • Loading branch information
ivanfetch-wt authored Jul 15, 2022
1 parent 25ab600 commit 50d789f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/kube/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ type resourceKindMap map[string][]GenericResource

func (rkm resourceKindMap) addResource(r GenericResource) {
gvk := r.Resource.GroupVersionKind()
key := gvk.Group + "/" + gvk.Kind
var key string
if gvk.Group != "" {
key = gvk.Group + "/" + gvk.Kind
} else {
key = gvk.Kind
}
rkm[key] = append(rkm[key], r)
}

Expand Down

0 comments on commit 50d789f

Please sign in to comment.