From 1f1d5f47c3953f7c69b524ba3b2d8ff4023b6761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=80=E5=AE=97?= Date: Mon, 1 Apr 2019 23:02:19 +0800 Subject: [PATCH] code style --- pkg/cephfs/mountcache.go | 4 ++-- pkg/cephfs/mountcache_test.go | 2 +- pkg/cephfs/nodeserver.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/cephfs/mountcache.go b/pkg/cephfs/mountcache.go index 60e5fad81..c8bc2a03b 100644 --- a/pkg/cephfs/mountcache.go +++ b/pkg/cephfs/mountcache.go @@ -143,7 +143,7 @@ func mountOneCacheEntry(ce *controllerCacheEntry, me *volumeMountCacheEntry) err klog.Errorf("mount-cache: failed to bind-mount volume %s: %s %s %v %v", volID, me.StagingPath, targetPath, readOnly, err) } else { - klog.Infof("mount-cache: successfully bind-mount volume %s: %s %s %v", + klog.Infof("mount-cache: successfully bind-mounted volume %s: %s %s %v", volID, me.StagingPath, targetPath, readOnly) } } @@ -277,7 +277,7 @@ func (mc *volumeMountCacheMap) nodeUnPublishVolume(volID string, targetPath stri func (mc *volumeMountCacheMap) updateNodeCache(volID string) error { me := volumeMountCache.volumes[volID] if err := volumeMountCache.nodeCacheStore.Delete(genVolumeMountCacheFileName(volID)); err == nil { - klog.Infof("mount-cache: metadata notfound, delete mount cache failed for volume %s", volID) + klog.Infof("mount-cache: metadata not found, delete mount cache failed for volume %s", volID) } return mc.nodeCacheStore.Create(genVolumeMountCacheFileName(volID), me) } diff --git a/pkg/cephfs/mountcache_test.go b/pkg/cephfs/mountcache_test.go index 6bba59c55..e27053cd4 100644 --- a/pkg/cephfs/mountcache_test.go +++ b/pkg/cephfs/mountcache_test.go @@ -32,7 +32,7 @@ func TestEncodeDecodeCredentials(t *testing.T) { deSecrets := decodeCredentials(enSecrets) for key, value := range secrets { if deSecrets[key] != value { - t.Errorf("key %s value %s not equal %s after encode decode", key, value, deSecrets[key]) + t.Errorf("key %s of credentials's value %s change after decode %s ", key, value, deSecrets[key]) } } } diff --git a/pkg/cephfs/nodeserver.go b/pkg/cephfs/nodeserver.go index 56d909ba9..273471e05 100644 --- a/pkg/cephfs/nodeserver.go +++ b/pkg/cephfs/nodeserver.go @@ -155,7 +155,7 @@ func (*NodeServer) mount(volOptions *volumeOptions, req *csi.NodeStageVolumeRequ return status.Error(codes.Internal, err.Error()) } if err := volumeMountCache.nodeStageVolume(req.GetVolumeId(), stagingTargetPath, req.GetSecrets()); err != nil { - klog.Warningf("mount-cache: failed stage volume %s %s: %v", volID, stagingTargetPath, err) + klog.Warningf("mount-cache: failed to stage volume %s %s: %v", volID, stagingTargetPath, err) } return nil } @@ -199,7 +199,7 @@ func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis } if err := volumeMountCache.nodePublishVolume(volID, targetPath, req.GetReadonly()); err != nil { - klog.Warningf("mount-cache: failed publish volume %s %s: %v", volID, targetPath, err) + klog.Warningf("mount-cache: failed to publish volume %s %s: %v", volID, targetPath, err) } klog.Infof("cephfs: successfully bind-mounted volume %s to %s", volID, targetPath) @@ -218,7 +218,7 @@ func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu volID := req.GetVolumeId() if err = volumeMountCache.nodeUnPublishVolume(volID, targetPath); err != nil { - klog.Warningf("mount-cache: failed unpublish volume %s %s: %v", volID, targetPath, err) + klog.Warningf("mount-cache: failed to unpublish volume %s %s: %v", volID, targetPath, err) } // Unmount the bind-mount @@ -246,7 +246,7 @@ func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag volID := req.GetVolumeId() if err = volumeMountCache.nodeUnStageVolume(volID); err != nil { - klog.Warningf("mount-cache: failed unstage volume %s %s: %v", volID, stagingTargetPath, err) + klog.Warningf("mount-cache: failed to unstage volume %s %s: %v", volID, stagingTargetPath, err) } // Unmount the volume