Skip to content

Commit

Permalink
Do not process a namespace again if it's already processed
Browse files Browse the repository at this point in the history
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
  • Loading branch information
bk201 authored and yasker committed Sep 4, 2021
1 parent d6e566c commit 189e740
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/manager/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,17 @@ func (c *Cluster) generateSupportBundleYAMLs(yamlsDir string, errLog io.Writer)
// Namespaced scope: all resources
namespaces := []string{"default", "kube-system", "cattle-system"}
namespaces = append(namespaces, c.sbm.Namespaces...)

done := make(map[string]struct{})
for _, namespace := range namespaces {
if _, ok := done[namespace]; ok {
continue
}

namespacedDir := filepath.Join(yamlsDir, "namespaced", namespace)
c.generateDiscoveredNamespacedYAMLs(namespace, namespacedDir, errLog)

done[namespace] = struct{}{}
}
}

Expand Down

0 comments on commit 189e740

Please sign in to comment.