Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Removes duplicate printing of the included namespaces #383

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
yonahd marked this conversation as resolved.
Show resolved Hide resolved
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 {
yonahd marked this conversation as resolved.
Show resolved Hide resolved
namespacesMap[ns.Name] = false
}

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