Skip to content

Commit 8355999

Browse files
committed
feat: Changed to V(4) log
1 parent 264e149 commit 8355999

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

populator-machinery/controller.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ func (c *controller) runWorker() {
613613
}
614614

615615
func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName string) error {
616-
klog.V(1).Infof("Starting sync for PVC %s/%s", pvcNamespace, pvcName)
617616
if c.populatorNamespace == pvcNamespace {
618617
// Ignore PVCs in our own working namespace
619618
return nil
@@ -689,15 +688,15 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
689688
}
690689

691690
if err := c.checkIntreeStorageClass(pvc, storageClass); err != nil {
692-
klog.V(2).Infof("Ignoring PVC %s/%s: %s", pvcNamespace, pvcName, err)
691+
klog.V(4).Infof("Ignoring PVC %s/%s: %s", pvcNamespace, pvcName, err)
693692
return nil
694693
}
695694

696695
if storageClass.VolumeBindingMode != nil && storagev1.VolumeBindingWaitForFirstConsumer == *storageClass.VolumeBindingMode {
697696
waitForFirstConsumer = true
698697
nodeName = pvc.Annotations[annSelectedNode]
699698
if nodeName == "" {
700-
klog.V(2).InfoS("Waiting for node selection due to WaitForFirstConsumer mode", "pvc", klog.KObj(pvc))
699+
klog.V(4).Infof("Waiting for node selection due to WaitForFirstConsumer mode for PVC %s/%s", pvc.Namespace, pvc.Name)
701700
// Wait for the PVC to get a node name before continuing
702701
return nil
703702
}
@@ -783,7 +782,7 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
783782
return err
784783
}
785784
params.PvcPrime = pvcPrime
786-
klog.V(2).InfoS("Created PVC Prime for data population", "pvc", klog.KObj(pvc), "pvcPrime", klog.KObj(pvcPrime))
785+
klog.V(4).Infof("Created pvcPrime %s/%s for data population of PVC %s/%s", pvcPrime.Namespace, pvcPrime.Name, pvc.Namespace, pvc.Name)
787786
}
788787

789788
if "" == pvc.Spec.VolumeName {
@@ -803,7 +802,6 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
803802
if c.providerFunctionConfig.PopulateFn != nil {
804803

805804
if "" == pvcPrime.Spec.VolumeName {
806-
klog.V(2).InfoS("Waiting for PVC Prime to be bound", "pvc", klog.KObj(pvc), "pvcPrime", klog.KObj(pvcPrime))
807805
// We'll get called again later when the pvcPrime gets bounded
808806
return nil
809807
}
@@ -822,7 +820,7 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
822820
return err
823821
}
824822
if !complete {
825-
klog.Infof("Data population for PVC %s/%s is not yet complete. Requeuing to check again later.", pvc.Namespace, pvc.Name)
823+
klog.V(4).Infof("Data population for PVC %s/%s is not yet complete. Requeuing to check again later.", pvc.Namespace, pvc.Name)
826824
// TODO: Revisited if there is a better way to requeue pvc than return an error
827825
// Return error to force reque pvc. We'll get called again later when the population operation complete
828826
return fmt.Errorf(reasonWaitForDataPopulationFinished)
@@ -886,7 +884,7 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
886884
return err
887885
}
888886
c.recorder.Eventf(pvc, corev1.EventTypeNormal, reasonPodCreationSuccess, "Populator started")
889-
klog.V(2).InfoS("Created populator pod", "pvc", klog.KObj(pvc), "pod", klog.KObj(pod))
887+
klog.V(4).Infof("Created populator pod %s/%s for PVC %s/%s", pod.Namespace, pod.Name, pvc.Namespace, pvc.Name)
890888

891889
// We'll get called again later when the pod exists
892890
return nil
@@ -901,7 +899,7 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
901899
if err != nil {
902900
return err
903901
}
904-
klog.V(2).InfoS("Cleaned up populator pod", "pvc", klog.KObj(pvc), "pod", klog.KObj(pod))
902+
klog.V(4).Infof("Cleaned up temporary populator pod %s/%s for PVC %s/%s", pod.Namespace, pod.Name, pvc.Namespace, pvc.Name)
905903
}
906904
// We'll get called again later when the pod succeeds
907905
return nil
@@ -954,7 +952,7 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
954952
if err != nil {
955953
return err
956954
}
957-
klog.V(2).InfoS("Successfully rebound PV to target PVC", "pv", klog.KObj(pv), "pvc", klog.KObj(pvc))
955+
klog.V(4).Infof("Successfully rebound PV %s to target PVC %s/%s", pv.Name, pvc.Namespace, pvc.Name)
958956

959957
// Don't start cleaning up yet -- we need to bind controller to acknowledge
960958
// the switch
@@ -1008,7 +1006,7 @@ func (c *controller) syncPvc(ctx context.Context, key, pvcNamespace, pvcName str
10081006
if err != nil {
10091007
return err
10101008
}
1011-
klog.V(2).InfoS("Cleaned up temporary populator resources", "pvc", klog.KObj(pvc))
1009+
klog.V(4).Infof("Cleaned up temporary populator resources for PVC %s/%s", pvc.Namespace, pvc.Name)
10121010

10131011
// Clean up our internal callback maps
10141012
c.cleanupNotifications(key)

0 commit comments

Comments
 (0)