Skip to content

Commit 50d789f

Browse files
authored
Fix resourceKindMap.addResource() to not assume every Kind has an APIGroup (#805)
This was causing the `ResourceProvider.Resources` map to essentially loose resources with no APIGroup, such as ServiceAccounts.
1 parent 25ab600 commit 50d789f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/kube/resources.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ type resourceKindMap map[string][]GenericResource
5959

6060
func (rkm resourceKindMap) addResource(r GenericResource) {
6161
gvk := r.Resource.GroupVersionKind()
62-
key := gvk.Group + "/" + gvk.Kind
62+
var key string
63+
if gvk.Group != "" {
64+
key = gvk.Group + "/" + gvk.Kind
65+
} else {
66+
key = gvk.Kind
67+
}
6368
rkm[key] = append(rkm[key], r)
6469
}
6570

0 commit comments

Comments
 (0)