Skip to content

Commit 36af7fd

Browse files
committed
fix: fix the bug due to vendor update
Signed-off-by: ZeroMagic <[email protected]>
1 parent 639701b commit 36af7fd

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

pkg/blobfuse/blobfuse.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ import (
2626
"github.com/pborman/uuid"
2727
"golang.org/x/net/context"
2828
"k8s.io/klog"
29-
"k8s.io/utils/mount"
3029
k8sutil "k8s.io/kubernetes/pkg/volume/util"
3130
"k8s.io/legacy-cloud-providers/azure"
31+
utilexec "k8s.io/utils/exec"
32+
"k8s.io/utils/mount"
3233
)
3334

3435
const (
@@ -89,7 +90,7 @@ func (d *Driver) Run(endpoint, kubeconfig string) {
8990

9091
d.mounter = &mount.SafeFormatAndMount{
9192
Interface: mount.New(""),
92-
Exec: mount.NewOsExec(),
93+
Exec: utilexec.New(),
9394
}
9495

9596
// Initialize default library driver

pkg/blobfuse/controllerserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
8383
if strings.HasPrefix(strings.ToLower(storageAccountType), "premium") {
8484
accountKind = string(storage.BlockBlobStorage)
8585
}
86-
account, accountKey, err := d.cloud.EnsureStorageAccount(accountName, storageAccountType, accountKind, resourceGroup, location, blobfuseAccountNamePrefix)
86+
account, accountKey, err := d.cloud.EnsureStorageAccount(accountName, storageAccountType, accountKind, resourceGroup, location, blobfuseAccountNamePrefix, false)
8787
if err != nil {
8888
return nil, fmt.Errorf("could not get storage key for storage account %s: %v", accountName, err)
8989
}

pkg/blobfuse/nodeserver.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ import (
2323
"os/exec"
2424
"strings"
2525

26+
volumehelper "sigs.k8s.io/blobfuse-csi-driver/pkg/util"
27+
2628
"github.com/container-storage-interface/spec/lib/go/csi"
2729

2830
"k8s.io/klog"
29-
"k8s.io/utils/mount"
3031
"k8s.io/kubernetes/pkg/volume/util"
32+
"k8s.io/utils/mount"
3133

3234
"google.golang.org/grpc/codes"
3335
"google.golang.org/grpc/status"
@@ -267,7 +269,7 @@ func (d *Driver) ensureMountPoint(target string) error {
267269
// notMnt = true
268270
}
269271

270-
if err := d.mounter.MakeDir(target); err != nil {
272+
if err := volumehelper.MakeDir(target); err != nil {
271273
klog.Errorf("MakeDir failed on target: %s (%v)", target, err)
272274
return err
273275
}

pkg/util/util.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ limitations under the License.
1616

1717
package util
1818

19+
import (
20+
"os"
21+
)
22+
1923
const (
2024
GiB = 1024 * 1024 * 1024
2125
)
@@ -66,3 +70,13 @@ func GetMountOptions(options []string) string {
6670
}
6771
return str
6872
}
73+
74+
func MakeDir(pathname string) error {
75+
err := os.MkdirAll(pathname, os.FileMode(0755))
76+
if err != nil {
77+
if !os.IsExist(err) {
78+
return err
79+
}
80+
}
81+
return nil
82+
}

0 commit comments

Comments
 (0)