Merge pull request #56487 from zhangxiaoyu-zidif/fix-binary-check-glusterfs
Automatic merge from submit-queue (batch tested with PRs 56413, 56322, 56490, 56460, 56487). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix binary check for glusterfs.go **What this PR does / why we need it**: err check can't show that the binary does not exist. If the binary does not exist, the err still be nil ever. we should use "test -x" to check if the binary exist. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #56479 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
		| @@ -238,7 +238,7 @@ func (b *glusterfsMounter) CanMount() error { | ||||
| 	exe := b.plugin.host.GetExec(b.plugin.GetPluginName()) | ||||
| 	switch runtime.GOOS { | ||||
| 	case "linux": | ||||
| 		if _, err := exe.Run("/bin/ls", gciLinuxGlusterMountBinaryPath); err != nil { | ||||
| 		if _, err := exe.Run("test", "-x", gciLinuxGlusterMountBinaryPath); err != nil { | ||||
| 			return fmt.Errorf("Required binary %s is missing", gciLinuxGlusterMountBinaryPath) | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Submit Queue
					Kubernetes Submit Queue