Skip to content

Commit 3e35f70

Browse files
committed
Update FuseMount to fix rclone mount issue
Signed-off-by: Mayank Sachan <[email protected]>
1 parent 0ab377c commit 3e35f70

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
branches:
6-
- main
6+
- rclone-timeout-fix
77

88
jobs:
99
release:
@@ -16,8 +16,8 @@ jobs:
1616
- cos-csi-mounter
1717

1818
env:
19-
IS_LATEST_RELEASE: 'true'
20-
APP_VERSION: 1.0.3
19+
IS_LATEST_RELEASE: 'false'
20+
APP_VERSION: 0.5.27
2121

2222
steps:
2323
- name: Checkout Code
@@ -63,9 +63,9 @@ jobs:
6363
/home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz.sha256
6464
/home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz
6565
/home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz.sha256
66-
tag_name: v1.0.3
67-
name: v1.0.3
68-
## body:
66+
tag_name: 0.5.27
67+
name: 0.5.27
68+
body: Fix rclone timeout issue
6969
prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }}
7070

7171
- name: Perform CodeQL Analysis

cos-csi-mounter/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME := cos-csi-mounter
2-
APP_VERSION := 1.0.3
2+
APP_VERSION := 0.5.27
33
BUILD_DIR := $(NAME)-$(APP_VERSION)
44
BIN_DIR := bin
55

cos-csi-mounter/server/rclone.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type RCloneArgs struct {
4040
VfsWriteBack string `json:"vfs-write-back,omitempty"`
4141
VfsWriteWait string `json:"vfs-write-wait,omitempty"`
4242
WriteBackCache string `json:"write-back-cache,omitempty"`
43+
InvalidValue string `json:"invalid-value,omitempty"`
4344
}
4445

4546
func (args RCloneArgs) PopulateArgsSlice(bucket, targetPath string) ([]string, error) {

pkg/mounter/utils/mounter_utils.go

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package utils
55

66
import (
7+
"bytes"
78
"errors"
89
"fmt"
910
"os"
@@ -31,18 +32,30 @@ type MounterOptsUtils struct {
3132
}
3233

3334
func (su *MounterOptsUtils) FuseMount(path string, comm string, args []string) error {
34-
klog.Info("-FuseMount-")
35-
klog.Infof("FuseMount params:\n\tpath: <%s>\n\tcommand: <%s>\n\targs: <%s>", path, comm, args)
36-
out, err := command(comm, args...).CombinedOutput()
35+
klog.Infof("FuseMount params:\n\tpath: <%s>\n\tcommand: <%s>\n\targs: <%v>", path, comm, args)
36+
cmd := command(comm, args...)
37+
38+
var outb, errb bytes.Buffer
39+
cmd.Stdout = &outb
40+
cmd.Stderr = &errb
41+
42+
err := cmd.Start()
43+
if err != nil {
44+
klog.Errorf("FuseMount: command start failed: <%s>\nargs: <%v>\nerror: <%v>", comm, args, err)
45+
return fmt.Errorf("FuseMount: command start failed: <%s>\nerror: <%v>", comm, err)
46+
}
47+
err = cmd.Wait()
3748
if err != nil {
3849
if mounted, err1 := isMountpoint(path); err1 == nil && mounted { // check if bucket already got mounted
3950
klog.Infof("bucket is already mounted using '%s' mounter", comm)
4051
return nil
4152
}
42-
klog.Errorf("FuseMount: command execution failed: <%s>\nargs: <%s>\nerror: <%v>\noutput: <%v>", comm, args, err, string(out))
43-
return fmt.Errorf("'%s' mount failed: <%v>", comm, string(out))
53+
klog.Errorf("FuseMount: command wait failed: <%s>\nargs: <%v>\nerr: <%v>\nstderr: <%s>\nstdout: <%s>", comm, args, err, errb.String(), outb.String())
54+
return fmt.Errorf("'%s' mount failed: %v (stderr: %s)", comm, err, errb.String())
4455
}
56+
klog.Infof("mount command succeeded: mounter=%s, output=%s", comm, outb.String())
4557
if err := waitForMount(path, 10*time.Second); err != nil {
58+
klog.Errorf("mount succeeded but waiting for mountpoint failed: %v", err)
4659
return err
4760
}
4861
klog.Infof("bucket mounted successfully using '%s' mounter", comm)

0 commit comments

Comments
 (0)