Take all resource versions into account during GC
@@ -247,10 +247,10 @@ func (c *Cluster) getAllowedResourcesBySelector(selector string) (map[string]*ku
return nil, err
}
- resources := []*meta_v1.APIResourceList{}
+ var resources []*meta_v1.APIResourceList
for i := range sgs.Groups {
- gv := sgs.Groups[i].PreferredVersion.GroupVersion
-
+ for _, v := range sgs.Groups[i].Versions {
+ gv := v.GroupVersion
excluded := false
for _, exp := range c.resourceExcludeList {
if glob.Glob(exp, fmt.Sprintf("%s/", gv)) {
@@ -272,6 +272,7 @@ func (c *Cluster) getAllowedResourcesBySelector(selector string) (map[string]*ku
}
}
}
+ }
result := map[string]*kuberesource{}
