@@ -94,7 +94,7 @@ func (d *nodeService) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag
9494
9595// NodePublishVolume Mounts the PV at the target path.
9696func (d * nodeService ) NodePublishVolume (ctx context.Context , req * csi.NodePublishVolumeRequest ) (* csi.NodePublishVolumeResponse , error ) {
97- klog .V (4 ).Infof ("NodePublishVolume: Called with args %+v " , req )
97+ klog .V (4 ).InfoS ("NodePublishVolume: Called with" , " args" , * req )
9898
9999 volumeID := req .GetVolumeId ()
100100 if len (volumeID ) == 0 {
@@ -173,7 +173,7 @@ func (d *nodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublis
173173 }
174174 }
175175
176- klog .V (5 ).Infof ("NodePublishVolume: Creating dir %s " , targetPath )
176+ klog .V (5 ).InfoS ("NodePublishVolume: creating" , " dir" , targetPath )
177177 if err := d .mounter .MakeDir (targetPath ); err != nil {
178178 return nil , status .Errorf (codes .Internal , "NodePublishVolume: Could not create target dir %q: %v" , targetPath , err )
179179 }
@@ -185,9 +185,9 @@ func (d *nodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublis
185185 }
186186
187187 if mounted {
188- klog .V (5 ).Infof ("NodePublishVolume: Target dir %q is already mounted with a volume. Not mounting volume source %q" , targetPath , source )
188+ klog .V (5 ).InfoS ("NodePublishVolume: Target path is already mounted with a volume. Not mounting." , "targetPath" , targetPath , "source" , source )
189189 } else {
190- klog .V (5 ).Infof ("NodePublishVolume: Attempting to mount with volumeID(%v) source(%s) targetPath(%s) mountflags(%v) " , volumeID , source , targetPath , mountOptions )
190+ klog .V (5 ).InfoS ("NodePublishVolume: Attempting to mount" , "volumeId" , volumeID , " source" , source , "targetPath" , targetPath , "mountOptions" , mountOptions )
191191 err = d .mounter .Mount (source , targetPath , "nfs" , mountOptions )
192192 if err != nil {
193193 if os .IsPermission (err ) {
@@ -198,14 +198,14 @@ func (d *nodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublis
198198 }
199199 return nil , status .Error (codes .Internal , err .Error ())
200200 }
201- klog .V (5 ).Infof ("NodePublishVolume: Successfully mounted at target path %s " , targetPath )
201+ klog .V (5 ).InfoS ("NodePublishVolume: Successfully mounted at" , "targetPath " , targetPath )
202202 }
203203 return & csi.NodePublishVolumeResponse {}, nil
204204}
205205
206206// NodeUnpublishVolume Unmounts the volume from the target path
207207func (d * nodeService ) NodeUnpublishVolume (ctx context.Context , req * csi.NodeUnpublishVolumeRequest ) (* csi.NodeUnpublishVolumeResponse , error ) {
208- klog .V (4 ).Infof ("NodeUnpublishVolume: Called with args %+v " , req )
208+ klog .V (4 ).InfoS ("NodeUnpublishVolume: called with" , " args" , * req )
209209
210210 volumeID := req .GetVolumeId ()
211211 if len (volumeID ) == 0 {
@@ -228,11 +228,11 @@ func (d *nodeService) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
228228 // Check if the target is mounted before unmounting
229229 notMnt , _ := d .mounter .IsLikelyNotMountPoint (targetPath )
230230 if notMnt {
231- klog .V (5 ).Infof ("NodeUnpublishVolume: Target path %s not mounted, skipping unmount" , targetPath )
231+ klog .V (5 ).InfoS ("NodeUnpublishVolume: Target path not mounted, skipping unmount" , "targetPath " , targetPath )
232232 return & csi.NodeUnpublishVolumeResponse {}, nil
233233 }
234234
235- klog .V (5 ).Infof ("NodeUnpublishVolume: Unmounting %s " , targetPath )
235+ klog .V (5 ).InfoS ("NodeUnpublishVolume: Unmounting" , "targetPath " , targetPath )
236236 err := d .mounter .Unmount (targetPath )
237237 if err != nil {
238238 return nil , status .Errorf (codes .Internal , "NodeUnpublishVolume: Could not unmount %q: %v" , targetPath , err )
@@ -256,7 +256,7 @@ func (d *nodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV
256256
257257// NodeGetCapabilities Returns the capabilities of the Node plugin
258258func (d * nodeService ) NodeGetCapabilities (ctx context.Context , req * csi.NodeGetCapabilitiesRequest ) (* csi.NodeGetCapabilitiesResponse , error ) {
259- klog .V (4 ).Infof ("NodeGetCapabilities: Called with args %+v " , req )
259+ klog .V (4 ).InfoS ("NodeGetCapabilities: Called with" , " args" , req )
260260 var caps []* csi.NodeServiceCapability
261261 for _ , cap := range nodeCaps {
262262 c := & csi.NodeServiceCapability {
@@ -273,7 +273,7 @@ func (d *nodeService) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetC
273273
274274// NodeGetInfo Returns the id of the node on which the plugin is running
275275func (d * nodeService ) NodeGetInfo (ctx context.Context , req * csi.NodeGetInfoRequest ) (* csi.NodeGetInfoResponse , error ) {
276- klog .V (4 ).Infof ("NodeGetInfo: called with args %+v " , req )
276+ klog .V (4 ).InfoS ("NodeGetInfo: called with" , " args" , * req )
277277 return & csi.NodeGetInfoResponse {
278278 NodeId : d .metadata .GetInstanceID (),
279279 }, nil
@@ -295,7 +295,7 @@ func (d *nodeService) isMounted(source string, targetPath string) (bool, error)
295295 // If the error is related to a corrupted mount, we can unmount then re-mount the volume.
296296 _ , pathErr := d .mounter .PathExists (targetPath )
297297 if pathErr != nil && d .mounter .IsCorruptedMnt (pathErr ) {
298- klog .V (4 ).Infof ("NodePublishVolume: Target path %q is a corrupted mount. Trying to unmount." , targetPath )
298+ klog .V (4 ).InfoS ("NodePublishVolume: Target path is a corrupted mount. Trying to unmount." , "targetPath " , targetPath )
299299 if mntErr := d .mounter .Unmount (targetPath ); mntErr != nil {
300300 return false , status .Errorf (codes .Internal , "NodePublishVolume: Unable to unmount the target %q : %v" , targetPath , mntErr )
301301 }
@@ -312,12 +312,12 @@ func (d *nodeService) isMounted(source string, targetPath string) (bool, error)
312312 // and in others it is an error (in Linux, the target mount directory must
313313 // exist before mount is called on it)
314314 if err != nil && os .IsNotExist (err ) {
315- klog .V (5 ).Infof ("[Debug] NodePublishVolume: Target path %q does not exist" , targetPath )
315+ klog .V (5 ).InfoS ("[Debug] NodePublishVolume: Target path does not exist" , "targetPath " , targetPath )
316316 return false , nil
317317 }
318318
319319 if ! notMnt {
320- klog .V (4 ).Infof ("NodePublishVolume: Target path %q is already mounted" , targetPath )
320+ klog .V (4 ).InfoS ("NodePublishVolume: Target path is already mounted" , "targetPath " , targetPath )
321321 }
322322
323323 return ! notMnt , nil
0 commit comments