mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Merge pull request #69089 from soltysh/kubectl_issue539
Deduplicate list of directories
This commit is contained in:
commit
2588ad5f36
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user