@@ -584,7 +584,7 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
584
584
devicePath := volumeToMount .DevicePath
585
585
if volumeAttacher != nil {
586
586
// Wait for attachable volumes to finish attaching
587
- klog .Infof (volumeToMount .GenerateMsgDetailed ("MountVolume.WaitForAttach entering" , fmt .Sprintf ("DevicePath %q" , volumeToMount .DevicePath )))
587
+ klog .InfoS (volumeToMount .GenerateMsgDetailed ("MountVolume.WaitForAttach entering" , fmt .Sprintf ("DevicePath %q" , volumeToMount .DevicePath )), "pod" , klog . KObj ( volumeToMount . Pod ))
588
588
589
589
devicePath , err = volumeAttacher .WaitForAttach (
590
590
volumeToMount .VolumeSpec , devicePath , volumeToMount .Pod , waitForAttachTimeout )
@@ -594,7 +594,7 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
594
594
return volumetypes .NewOperationContext (eventErr , detailedErr , migrated )
595
595
}
596
596
597
- klog .Infof (volumeToMount .GenerateMsgDetailed ("MountVolume.WaitForAttach succeeded" , fmt .Sprintf ("DevicePath %q" , devicePath )))
597
+ klog .InfoS (volumeToMount .GenerateMsgDetailed ("MountVolume.WaitForAttach succeeded" , fmt .Sprintf ("DevicePath %q" , devicePath )), "pod" , klog . KObj ( volumeToMount . Pod ))
598
598
}
599
599
600
600
var resizeDone bool
@@ -627,7 +627,7 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
627
627
return volumetypes .NewOperationContext (eventErr , detailedErr , migrated )
628
628
}
629
629
630
- klog .Infof (volumeToMount .GenerateMsgDetailed ("MountVolume.MountDevice succeeded" , fmt .Sprintf ("device mount path %q" , deviceMountPath )))
630
+ klog .InfoS (volumeToMount .GenerateMsgDetailed ("MountVolume.MountDevice succeeded" , fmt .Sprintf ("device mount path %q" , deviceMountPath )), "pod" , klog . KObj ( volumeToMount . Pod ))
631
631
632
632
// Update actual state of world to reflect volume is globally mounted
633
633
markDeviceMountedErr := actualStateOfWorld .MarkDeviceAsMounted (
@@ -659,9 +659,9 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
659
659
volumeToMount .VolumeName , devicePath , deviceMountPath )
660
660
if markDeviceUncertainErr != nil {
661
661
// just log, return the resizeError error instead
662
- klog .Infof (volumeToMount .GenerateMsgDetailed (
662
+ klog .InfoS (volumeToMount .GenerateMsgDetailed (
663
663
"MountVolume.MountDevice failed to mark volume as uncertain" ,
664
- markDeviceUncertainErr .Error ()))
664
+ markDeviceUncertainErr .Error ()), "pod" , klog . KObj ( volumeToMount . Pod ) )
665
665
}
666
666
eventErr , detailedErr := volumeToMount .GenerateError ("MountVolume.MountDevice failed while expanding volume" , resizeError )
667
667
return volumetypes .NewOperationContext (eventErr , detailedErr , migrated )
@@ -704,12 +704,12 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
704
704
return volumetypes .NewOperationContext (eventErr , detailedErr , migrated )
705
705
}
706
706
707
- _ , detailedMsg := volumeToMount .GenerateMsg ("MountVolume.SetUp succeeded" , "" )
707
+ detailedMsg := volumeToMount .GenerateMsgDetailed ("MountVolume.SetUp succeeded" , "" )
708
708
verbosity := klog .Level (1 )
709
709
if isRemount {
710
710
verbosity = klog .Level (4 )
711
711
}
712
- klog .V (verbosity ).Infof (detailedMsg )
712
+ klog .V (verbosity ).InfoS (detailedMsg , "pod" , klog . KObj ( volumeToMount . Pod ) )
713
713
resizeOptions .DeviceMountPath = volumeMounter .GetPath ()
714
714
resizeOptions .CSIVolumePhase = volume .CSIVolumePublished
715
715
@@ -1070,7 +1070,7 @@ func (og *operationGenerator) GenerateMapVolumeFunc(
1070
1070
}
1071
1071
if volumeAttacher != nil {
1072
1072
// Wait for attachable volumes to finish attaching
1073
- klog .Infof (volumeToMount .GenerateMsgDetailed ("MapVolume.WaitForAttach entering" , fmt .Sprintf ("DevicePath %q" , volumeToMount .DevicePath )))
1073
+ klog .InfoS (volumeToMount .GenerateMsgDetailed ("MapVolume.WaitForAttach entering" , fmt .Sprintf ("DevicePath %q" , volumeToMount .DevicePath )), "pod" , klog . KObj ( volumeToMount . Pod ))
1074
1074
1075
1075
devicePath , err = volumeAttacher .WaitForAttach (
1076
1076
volumeToMount .VolumeSpec , volumeToMount .DevicePath , volumeToMount .Pod , waitForAttachTimeout )
@@ -1080,7 +1080,7 @@ func (og *operationGenerator) GenerateMapVolumeFunc(
1080
1080
return volumetypes .NewOperationContext (eventErr , detailedErr , migrated )
1081
1081
}
1082
1082
1083
- klog .Infof (volumeToMount .GenerateMsgDetailed ("MapVolume.WaitForAttach succeeded" , fmt .Sprintf ("DevicePath %q" , devicePath )))
1083
+ klog .InfoS (volumeToMount .GenerateMsgDetailed ("MapVolume.WaitForAttach succeeded" , fmt .Sprintf ("DevicePath %q" , devicePath )), "pod" , klog . KObj ( volumeToMount . Pod ))
1084
1084
1085
1085
}
1086
1086
// Call SetUpDevice if blockVolumeMapper implements CustomBlockVolumeMapper
@@ -1188,13 +1188,13 @@ func (og *operationGenerator) GenerateMapVolumeFunc(
1188
1188
simpleMsg , detailedMsg := volumeToMount .GenerateMsg ("MapVolume.MapPodDevice succeeded" , fmt .Sprintf ("globalMapPath %q" , globalMapPath ))
1189
1189
verbosity := klog .Level (4 )
1190
1190
og .recorder .Eventf (volumeToMount .Pod , v1 .EventTypeNormal , kevents .SuccessfulMountVolume , simpleMsg )
1191
- klog .V (verbosity ).Infof (detailedMsg )
1191
+ klog .V (verbosity ).InfoS (detailedMsg , "pod" , klog . KObj ( volumeToMount . Pod ) )
1192
1192
1193
1193
// Device mapping for pod device map path succeeded
1194
1194
simpleMsg , detailedMsg = volumeToMount .GenerateMsg ("MapVolume.MapPodDevice succeeded" , fmt .Sprintf ("volumeMapPath %q" , volumeMapPath ))
1195
1195
verbosity = klog .Level (1 )
1196
1196
og .recorder .Eventf (volumeToMount .Pod , v1 .EventTypeNormal , kevents .SuccessfulMountVolume , simpleMsg )
1197
- klog .V (verbosity ).Infof (detailedMsg )
1197
+ klog .V (verbosity ).InfoS (detailedMsg , "pod" , klog . KObj ( volumeToMount . Pod ) )
1198
1198
1199
1199
resizeOptions := volume.NodeResizeOptions {
1200
1200
DevicePath : devicePath ,
@@ -1520,7 +1520,7 @@ func (og *operationGenerator) GenerateVerifyControllerAttachedVolumeFunc(
1520
1520
if attachedVolume .Name == volumeToMount .VolumeName {
1521
1521
addVolumeNodeErr := actualStateOfWorld .MarkVolumeAsAttached (
1522
1522
v1 .UniqueVolumeName ("" ), volumeToMount .VolumeSpec , nodeName , attachedVolume .DevicePath )
1523
- klog .Infof (volumeToMount .GenerateMsgDetailed ("Controller attach succeeded" , fmt .Sprintf ("device path: %q" , attachedVolume .DevicePath )))
1523
+ klog .InfoS (volumeToMount .GenerateMsgDetailed ("Controller attach succeeded" , fmt .Sprintf ("device path: %q" , attachedVolume .DevicePath )), "pod" , klog . KObj ( volumeToMount . Pod ))
1524
1524
if addVolumeNodeErr != nil {
1525
1525
// On failure, return error. Caller will log and retry.
1526
1526
eventErr , detailedErr := volumeToMount .GenerateError ("VerifyControllerAttachedVolume.MarkVolumeAsAttached failed" , addVolumeNodeErr )
@@ -1835,7 +1835,7 @@ func (og *operationGenerator) nodeExpandVolume(
1835
1835
pvSpecCap := pv .Spec .Capacity [v1 .ResourceStorage ]
1836
1836
if pvcStatusCap .Cmp (pvSpecCap ) < 0 {
1837
1837
// File system resize was requested, proceed
1838
- klog .V (4 ).Infof (volumeToMount .GenerateMsgDetailed ("MountVolume.NodeExpandVolume entering" , fmt .Sprintf ("DevicePath %q" , volumeToMount .DevicePath )))
1838
+ klog .V (4 ).InfoS (volumeToMount .GenerateMsgDetailed ("MountVolume.NodeExpandVolume entering" , fmt .Sprintf ("DevicePath %q" , volumeToMount .DevicePath )), "pod" , klog . KObj ( volumeToMount . Pod ))
1839
1839
1840
1840
if volumeToMount .VolumeSpec .ReadOnly {
1841
1841
simpleMsg , detailedMsg := volumeToMount .GenerateMsg ("MountVolume.NodeExpandVolume failed" , "requested read-only file system" )
@@ -1868,7 +1868,7 @@ func (og *operationGenerator) nodeExpandVolume(
1868
1868
simpleMsg , detailedMsg := volumeToMount .GenerateMsg ("MountVolume.NodeExpandVolume succeeded" , "" )
1869
1869
og .recorder .Eventf (volumeToMount .Pod , v1 .EventTypeNormal , kevents .FileSystemResizeSuccess , simpleMsg )
1870
1870
og .recorder .Eventf (pvc , v1 .EventTypeNormal , kevents .FileSystemResizeSuccess , simpleMsg )
1871
- klog .Infof (detailedMsg )
1871
+ klog .InfoS (detailedMsg , "pod" , klog . KObj ( volumeToMount . Pod ) )
1872
1872
// File system resize succeeded, now update the PVC's Capacity to match the PV's
1873
1873
err = util .MarkFSResizeFinished (pvc , pvSpecCap , og .kubeClient )
1874
1874
if err != nil {
0 commit comments