-
Notifications
You must be signed in to change notification settings - Fork 989
Open
kubernetes/kubernetes
#136689Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.sig/cliCategorizes an issue or PR as relevant to SIG CLI.Categorizes an issue or PR as relevant to SIG CLI.
Description
What happened:
kubectl plugin list fails to detect overshadowed plugins on Windows because plugin binary names are extracted using strings.Split(path, "/"), which does not recognize \ as a path separator.
What you expected to happen:
kubectl plugin list should correctly detect overshadowed plugins regardless of OS.
How to reproduce it (as minimally and precisely as possible):
- On Windows, place two plugins with the same name in different directories in PATH:
C:\path1\kubectl-foo.exeC:\path2\kubectl-foo.exe
kubectl plugin list- No overshadow warning is shown
Anything else we need to know?:
The issue is in staging/src/k8s.io/kubectl/pkg/cmd/plugin/plugin.go:
segs := strings.Split(path, "/")
binName := segs[len(segs)-1]This should be replaced with OS-independent method.
Environment:
- OS: Windows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.sig/cliCategorizes an issue or PR as relevant to SIG CLI.Categorizes an issue or PR as relevant to SIG CLI.