mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #120291 from lzhecheng/fix-credentialprovider-win-bin-path
Fix Windows credential provider cannot find binary
This commit is contained in:
commit
2efed1f1cb
@ -98,8 +98,10 @@ func RegisterCredentialProviderPlugins(pluginConfigFile, pluginBinDir string) er
|
||||
registerMetrics()
|
||||
|
||||
for _, provider := range credentialProviderConfig.Providers {
|
||||
pluginBin := filepath.Join(pluginBinDir, provider.Name)
|
||||
if _, err := os.Stat(pluginBin); err != nil {
|
||||
// Considering Windows binary with suffix ".exe", LookPath() helps to find the correct path.
|
||||
// LookPath() also calls os.Stat().
|
||||
pluginBin, err := exec.LookPath(filepath.Join(pluginBinDir, provider.Name))
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return fmt.Errorf("plugin binary executable %s did not exist", pluginBin)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user