Unverified Commit e9e190c5 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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 ```
parents d9b45d08 cbf0945a
......@@ -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)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment