mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-21 09:34:40 +00:00
Merge pull request #57264 from zhangxiaoyu-zidif/fix-binary-check-cephfs
Automatic merge from submit-queue. 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 cephfs.go **What this PR does / why we need it**: unify the check method. see ref issue: #56479 **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:
commit
389089846a
@ -331,9 +331,8 @@ func (cephfsMounter *cephfsMounter) checkFuseMount() bool {
|
|||||||
execute := cephfsMounter.plugin.host.GetExec(cephfsMounter.plugin.GetPluginName())
|
execute := cephfsMounter.plugin.host.GetExec(cephfsMounter.plugin.GetPluginName())
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "linux":
|
case "linux":
|
||||||
retBytes, err := execute.Run("/bin/ls", "/sbin/mount.fuse.ceph")
|
if _, err := execute.Run("/usr/bin/test", "-x", "/sbin/mount.fuse.ceph"); err == nil {
|
||||||
if err == nil && string(retBytes) == "/sbin/mount.fuse.ceph\n" {
|
glog.V(4).Infof("/sbin/mount.fuse.ceph exists, it should be fuse mount.")
|
||||||
glog.V(4).Infof("/sbin/mount.fuse.ceph exists, it should be fuse mount")
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@ -356,7 +355,7 @@ func (cephfsVolume *cephfs) execFuseMount(mountpoint string) error {
|
|||||||
payload := make(map[string]util.FileProjection, 1)
|
payload := make(map[string]util.FileProjection, 1)
|
||||||
var fileProjection util.FileProjection
|
var fileProjection util.FileProjection
|
||||||
|
|
||||||
keyring := fmt.Sprintf("[client.%s]\n", cephfsVolume.id) + "key = " + cephfsVolume.secret + "\n"
|
keyring := fmt.Sprintf("[client.%s]\nkey = %s\n", cephfsVolume.id, cephfsVolume.secret)
|
||||||
|
|
||||||
fileProjection.Data = []byte(keyring)
|
fileProjection.Data = []byte(keyring)
|
||||||
fileProjection.Mode = int32(0644)
|
fileProjection.Mode = int32(0644)
|
||||||
|
Loading…
Reference in New Issue
Block a user