Skip to content

Commit 5fc38a1

Browse files
andyzhangxk8s-infra-cherrypick-robot
authored andcommitted
chore: refine blobfuse mount logs
1 parent b313e4f commit 5fc38a1

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

pkg/blob/nodeserver.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
141141
}
142142

143143
func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []string) (string, error) {
144-
klog.V(2).Infof("mouting using blobfuse proxy")
145144
var resp *mount_azure_blob.MountAzureBlobResponse
146145
var output string
147146
connectionTimout := time.Duration(d.blobfuseProxyConnTimout) * time.Second
148147
ctx, cancel := context.WithTimeout(context.Background(), connectionTimout)
149148
defer cancel()
149+
klog.V(2).Infof("start connecting to blobfuse proxy, protocol: %s, args: %s", protocol, args)
150150
conn, err := grpc.DialContext(ctx, d.blobfuseProxyEndpoint, grpc.WithInsecure(), grpc.WithBlock())
151151
if err == nil {
152152
mountClient := NewMountClient(conn)
@@ -155,7 +155,7 @@ func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []
155155
Protocol: protocol,
156156
AuthEnv: authEnv,
157157
}
158-
klog.V(2).Infof("calling BlobfuseProxy: MountAzureBlob function")
158+
klog.V(2).Infof("begin to mount with blobfuse proxy, protocol: %s, args: %s", protocol, args)
159159
resp, err = mountClient.service.MountAzureBlob(context.TODO(), &mountreq)
160160
if err != nil {
161161
klog.Error("GRPC call returned with an error:", err)
@@ -168,15 +168,16 @@ func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []
168168
func (d *Driver) mountBlobfuseInsideDriver(args string, protocol string, authEnv []string) (string, error) {
169169
var cmd *exec.Cmd
170170

171-
klog.V(2).Infof("mounting blobfuse inside driver")
171+
mountLog := "mount inside driver with"
172172
if protocol == Fuse2 {
173-
klog.V(2).Infof("using blobfuse V2 to mount")
173+
mountLog += " v2"
174174
args = "mount " + args
175175
cmd = exec.Command("blobfuse2", strings.Split(args, " ")...)
176176
} else {
177-
klog.V(2).Infof("using blobfuse V1 to mount")
177+
mountLog += " v1"
178178
cmd = exec.Command("blobfuse", strings.Split(args, " ")...)
179179
}
180+
klog.V(2).Infof("%s, protocol: %s, args: %s", mountLog, protocol, args)
180181

181182
cmd.Env = append(os.Environ(), authEnv...)
182183
output, err := cmd.CombinedOutput()

pkg/blobfuse-proxy/server/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,22 @@ func (server *MountServer) MountAzureBlob(ctx context.Context,
6565
args := req.GetMountArgs()
6666
authEnv := req.GetAuthEnv()
6767
protocol := req.GetProtocol()
68-
klog.V(2).Infof("received mount request: Protocol: %s, server default blobfuseVersion: %v, Mounting with args %v \n", protocol, server.blobfuseVersion, args)
68+
klog.V(2).Infof("received mount request: protocol: %s, server default blobfuseVersion: %v, mount args %v \n", protocol, server.blobfuseVersion, args)
6969

7070
var cmd *exec.Cmd
7171
var result mount_azure_blob.MountAzureBlobResponse
7272
if protocol == blob.Fuse2 || server.blobfuseVersion == BlobfuseV2 {
73-
klog.V(2).Infof("using blobfuse V2 to mount")
7473
args = "mount " + args
7574
// add this arg for blobfuse2 to solve the issue:
7675
// https://github.com/Azure/azure-storage-fuse/issues/1015
7776
if !strings.Contains(args, "--ignore-open-flags") {
7877
klog.V(2).Infof("append --ignore-open-flags=true to mount args")
7978
args = args + " " + "--ignore-open-flags=true"
8079
}
80+
klog.V(2).Infof("mount with v2, protocol: %s, args: %s", protocol, args)
8181
cmd = exec.Command("blobfuse2", strings.Split(args, " ")...)
8282
} else {
83-
klog.V(2).Infof("using blobfuse V1 to mount")
83+
klog.V(2).Infof("mount with v1, protocol: %s, args: %s", protocol, args)
8484
cmd = exec.Command("blobfuse", strings.Split(args, " ")...)
8585
}
8686

0 commit comments

Comments
 (0)