@@ -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 {
@@ -165,7 +165,7 @@ func (d *nodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublis
165165 }
166166 }
167167
168- klog .V (5 ).Infof ("NodePublishVolume: Creating dir %s " , targetPath )
168+ klog .V (5 ).InfoS ("NodePublishVolume: creating" , " dir" , targetPath )
169169 if err := d .mounter .MakeDir (targetPath ); err != nil {
170170 return nil , status .Errorf (codes .Internal , "NodePublishVolume: Could not create target dir %q: %v" , targetPath , err )
171171 }
@@ -177,9 +177,9 @@ func (d *nodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublis
177177 }
178178
179179 if mounted {
180- klog .V (5 ).Infof ("NodePublishVolume: Target dir %q is already mounted with a volume. Not mounting volume source %q" , targetPath , source )
180+ klog .V (5 ).InfoS ("NodePublishVolume: Target path is already mounted with a volume. Not mounting." , "targetPath" , targetPath , "source" , source )
181181 } else {
182- klog .V (5 ).Infof ("NodePublishVolume: Attempting to mount with volumeID(%v) source(%s) targetPath(%s) mountflags(%v) " , volumeID , source , targetPath , mountOptions )
182+ klog .V (5 ).InfoS ("NodePublishVolume: Attempting to mount" , "volumeId" , volumeID , " source" , source , "targetPath" , targetPath , "mountOptions" , mountOptions )
183183 err = d .mounter .Mount (source , targetPath , "nfs" , mountOptions )
184184 if err != nil {
185185 if os .IsPermission (err ) {
@@ -190,14 +190,14 @@ func (d *nodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublis
190190 }
191191 return nil , status .Error (codes .Internal , err .Error ())
192192 }
193- klog .V (5 ).Infof ("NodePublishVolume: Successfully mounted at target path %s " , targetPath )
193+ klog .V (5 ).InfoS ("NodePublishVolume: Successfully mounted at" , "targetPath " , targetPath )
194194 }
195195 return & csi.NodePublishVolumeResponse {}, nil
196196}
197197
198198// NodeUnpublishVolume Unmounts the volume from the target path
199199func (d * nodeService ) NodeUnpublishVolume (ctx context.Context , req * csi.NodeUnpublishVolumeRequest ) (* csi.NodeUnpublishVolumeResponse , error ) {
200- klog .V (4 ).Infof ("NodeUnpublishVolume: Called with args %+v " , req )
200+ klog .V (4 ).InfoS ("NodeUnpublishVolume: called with" , " args" , * req )
201201
202202 volumeID := req .GetVolumeId ()
203203 if len (volumeID ) == 0 {
@@ -212,11 +212,11 @@ func (d *nodeService) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
212212 // Check if the target is mounted before unmounting
213213 notMnt , _ := d .mounter .IsLikelyNotMountPoint (targetPath )
214214 if notMnt {
215- klog .V (5 ).Infof ("NodeUnpublishVolume: Target path %s not mounted, skipping unmount" , targetPath )
215+ klog .V (5 ).InfoS ("NodeUnpublishVolume: Target path not mounted, skipping unmount" , "targetPath " , targetPath )
216216 return & csi.NodeUnpublishVolumeResponse {}, nil
217217 }
218218
219- klog .V (5 ).Infof ("NodeUnpublishVolume: Unmounting %s " , targetPath )
219+ klog .V (5 ).InfoS ("NodeUnpublishVolume: Unmounting" , "targetPath " , targetPath )
220220 err := d .mounter .Unmount (targetPath )
221221 if err != nil {
222222 return nil , status .Errorf (codes .Internal , "NodeUnpublishVolume: Could not unmount %q: %v" , targetPath , err )
@@ -240,7 +240,7 @@ func (d *nodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV
240240
241241// NodeGetCapabilities Returns the capabilities of the Node plugin
242242func (d * nodeService ) NodeGetCapabilities (ctx context.Context , req * csi.NodeGetCapabilitiesRequest ) (* csi.NodeGetCapabilitiesResponse , error ) {
243- klog .V (4 ).Infof ("NodeGetCapabilities: Called with args %+v " , req )
243+ klog .V (4 ).InfoS ("NodeGetCapabilities: Called with" , " args" , req )
244244 var caps []* csi.NodeServiceCapability
245245 for _ , cap := range nodeCaps {
246246 c := & csi.NodeServiceCapability {
@@ -257,7 +257,7 @@ func (d *nodeService) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetC
257257
258258// NodeGetInfo Returns the id of the node on which the plugin is running
259259func (d * nodeService ) NodeGetInfo (ctx context.Context , req * csi.NodeGetInfoRequest ) (* csi.NodeGetInfoResponse , error ) {
260- klog .V (4 ).Infof ("NodeGetInfo: called with args %+v " , req )
260+ klog .V (4 ).InfoS ("NodeGetInfo: called with" , " args" , * req )
261261 return & csi.NodeGetInfoResponse {
262262 NodeId : d .metadata .GetInstanceID (),
263263 }, nil
@@ -279,7 +279,7 @@ func (d *nodeService) isMounted(source string, targetPath string) (bool, error)
279279 // If the error is related to a corrupted mount, we can unmount then re-mount the volume.
280280 _ , pathErr := d .mounter .PathExists (targetPath )
281281 if pathErr != nil && d .mounter .IsCorruptedMnt (pathErr ) {
282- klog .V (4 ).Infof ("NodePublishVolume: Target path %q is a corrupted mount. Trying to unmount." , targetPath )
282+ klog .V (4 ).InfoS ("NodePublishVolume: Target path is a corrupted mount. Trying to unmount." , "targetPath " , targetPath )
283283 if mntErr := d .mounter .Unmount (targetPath ); mntErr != nil {
284284 return false , status .Errorf (codes .Internal , "NodePublishVolume: Unable to unmount the target %q : %v" , targetPath , mntErr )
285285 }
@@ -296,12 +296,12 @@ func (d *nodeService) isMounted(source string, targetPath string) (bool, error)
296296 // and in others it is an error (in Linux, the target mount directory must
297297 // exist before mount is called on it)
298298 if err != nil && os .IsNotExist (err ) {
299- klog .V (5 ).Infof ("[Debug] NodePublishVolume: Target path %q does not exist" , targetPath )
299+ klog .V (5 ).InfoS ("[Debug] NodePublishVolume: Target path does not exist" , "targetPath " , targetPath )
300300 return false , nil
301301 }
302302
303303 if ! notMnt {
304- klog .V (4 ).Infof ("NodePublishVolume: Target path %q is already mounted" , targetPath )
304+ klog .V (4 ).InfoS ("NodePublishVolume: Target path is already mounted" , "targetPath " , targetPath )
305305 }
306306
307307 return ! notMnt , nil
0 commit comments