From 26f3540d983ef259b94a617e792bfee5be3faaf3 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Fri, 10 Jan 2020 15:03:47 -0800 Subject: [PATCH] minor simplification of authCanI code in resources collector --- pkg/collect/cluster_resources.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/collect/cluster_resources.go b/pkg/collect/cluster_resources.go index e9a4f7f8..19c7db87 100644 --- a/pkg/collect/cluster_resources.go +++ b/pkg/collect/cluster_resources.go @@ -457,11 +457,7 @@ func authCanI(client *kubernetes.Clientset, namespaces []string) (map[string][]b continue } - rules := []rbacv1.PolicyRule{} - for _, rule := range convertToPolicyRule(response.Status) { - rules = append(rules, rule) - } - + rules := convertToPolicyRule(response.Status) b, err := json.MarshalIndent(rules, "", " ") if err != nil { errorsByNamespace[namespace] = err.Error()