Skip to content

Commit

Permalink
Fix: Removes duplicate printing of the included namespaces (#383)
Browse files Browse the repository at this point in the history
Removes unnecessary variables initialization

Co-authored-by: Aleksandar Milanov <[email protected]>
  • Loading branch information
almilaneze and Aleksandar Milanov authored Dec 2, 2024
1 parent cc34847 commit 050c06d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/filters/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"os"
"slices"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -120,6 +121,8 @@ func (o *Options) Namespaces(clientset kubernetes.Interface) []string {
excludeNamespaces := o.ExcludeNamespaces

if len(o.IncludeNamespaces) > 0 {
slices.Sort(includeNamespaces)
includeNamespaces = slices.Compact(includeNamespaces)

for _, ns := range includeNamespaces {

Expand All @@ -137,10 +140,6 @@ func (o *Options) Namespaces(clientset kubernetes.Interface) []string {
return
}

for _, ns := range namespaceList.Items {
namespacesMap[ns.Name] = false
}

for _, ns := range namespaceList.Items {
namespacesMap[ns.Name] = true
}
Expand Down

0 comments on commit 050c06d

Please sign in to comment.