Skip to content

Commit

Permalink
fix: clear counter between iterations (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
yonahd authored Nov 7, 2023
1 parent f0a67db commit 4e4d1cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/kor/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ func exportMetrics(includeExcludeLists IncludeExcludeLists, filterOptions *Filte
}

for {
if korOutput, err := GetUnusedAll(includeExcludeLists, filterOptions, clientset, outputFormat, opts); err != nil {
fmt.Println("collecting unused resources")
if korOutput, err := GetUnusedConfigmaps(includeExcludeLists, filterOptions, clientset, outputFormat, opts); err != nil {
fmt.Println(err)
os.Exit(1)
} else {
Expand All @@ -59,6 +60,8 @@ func exportMetrics(includeExcludeLists IncludeExcludeLists, filterOptions *Filte
return
}

orphanedResourcesCounter.Reset()

for namespace, resources := range data {
for kind, resourceList := range resources {
for _, resourceName := range resourceList {
Expand Down

0 comments on commit 4e4d1cb

Please sign in to comment.