mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-03 18:27:49 +00:00
Deduplicate list of directories
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||||
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
|
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
|
||||||
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||||
@@ -108,7 +109,8 @@ func (o *PluginListOptions) Run() error {
|
|||||||
pluginsFound := false
|
pluginsFound := false
|
||||||
isFirstFile := true
|
isFirstFile := true
|
||||||
pluginWarnings := 0
|
pluginWarnings := 0
|
||||||
for _, dir := range filepath.SplitList(os.Getenv(path)) {
|
paths := sets.NewString(filepath.SplitList(os.Getenv(path))...)
|
||||||
|
for _, dir := range paths.List() {
|
||||||
files, err := ioutil.ReadDir(dir)
|
files, err := ioutil.ReadDir(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user