diff --git a/pkg/azureutils/azure_disk_utils.go b/pkg/azureutils/azure_disk_utils.go index b7a9296b18..04bef67725 100644 --- a/pkg/azureutils/azure_disk_utils.go +++ b/pkg/azureutils/azure_disk_utils.go @@ -1132,7 +1132,7 @@ func UpdateCRIWithRetry(ctx context.Context, informerFactory azdiskinformers.Sha // if updateFunc doesn't change the object, don't bother making an update request if reflect.DeepEqual(originalObj, copyForUpdate) { updatedObj = copyForUpdate - w.Logger().Info("Skip update. No update needed.") + w.Logger().V(5).Info("Skip update. No update needed.") return nil } @@ -1176,7 +1176,7 @@ func UpdateCRIWithRetry(ctx context.Context, informerFactory azdiskinformers.Sha } if updatedObj == nil { - w.Logger().Info("No update applied - returning original object.") + w.Logger().V(5).Info("No update applied - returning original object.") updatedObj = originalObj.DeepCopyObject().(client.Object) } diff --git a/pkg/controller/attach_detach.go b/pkg/controller/attach_detach.go index 4b21604b42..6a133fb01b 100644 --- a/pkg/controller/attach_detach.go +++ b/pkg/controller/attach_detach.go @@ -184,7 +184,7 @@ func (r *ReconcileAttachDetach) triggerAttach(ctx context.Context, azVolumeAttac } azVolumeAttachment = updatedObj.(*azdiskv1beta2.AzVolumeAttachment) - w.Logger().Info("Attaching volume") + w.Logger().V(5).Info("Attaching volume") waitCh := make(chan goSignal) //nolint:contextcheck // call is asynchronous; context is not inherited by design go func() { @@ -415,7 +415,7 @@ func (r *ReconcileAttachDetach) demote(ctx context.Context, azVolumeAttachment * ctx, w := workflow.New(ctx) defer func() { w.Finish(err) }() - w.Logger().Info("Demoting AzVolumeAttachment") + w.Logger().V(5).Info("Demoting AzVolumeAttachment") // initialize metadata and update status block updateFunc := func(obj client.Object) error { azv := obj.(*azdiskv1beta2.AzVolumeAttachment) @@ -484,7 +484,7 @@ func (r *ReconcileAttachDetach) Recover(ctx context.Context) error { ctx, w := workflow.New(ctx) defer func() { w.Finish(err) }() - w.Logger().Info("Recovering AzVolumeAttachment CRIs...") + w.Logger().V(5).Info("Recovering AzVolumeAttachment CRIs...") // try to recreate missing AzVolumeAttachment CRI var syncedVolumeAttachments, volumesToSync map[string]bool diff --git a/pkg/controller/azvolume.go b/pkg/controller/azvolume.go index adcb3ca79b..b8c7780087 100644 --- a/pkg/controller/azvolume.go +++ b/pkg/controller/azvolume.go @@ -156,7 +156,7 @@ func (r *ReconcileAzVolume) triggerCreate(ctx context.Context, azVolume *azdiskv } azVolume = updatedObj.(*azdiskv1beta2.AzVolume) - w.Logger().Info("Creating Volume...") + w.Logger().V(5).Info("Creating Volume...") waitCh := make(chan goSignal) // create volume //nolint:contextcheck // call is asynchronous; context is not inherited by design @@ -248,7 +248,7 @@ func (r *ReconcileAzVolume) triggerDelete(ctx context.Context, azVolume *azdiskv azVolume = updatedObj.(*azdiskv1beta2.AzVolume) if volumeDeleteRequested { - w.Logger().Info("Deleting Volume...") + w.Logger().V(5).Info("Deleting Volume...") } waitCh := make(chan goSignal) @@ -607,7 +607,7 @@ func (r *ReconcileAzVolume) Recover(ctx context.Context) error { defer func() { w.Finish(err) }() // recover CRI if possible - w.Logger().Info("Recovering AzVolume CRIs...") + w.Logger().V(5).Info("Recovering AzVolume CRIs...") if err = r.recreateAzVolumes(ctx); err != nil { w.Logger().Error(err, "failed to recreate missing AzVolume CRI") } diff --git a/pkg/controller/shared_state.go b/pkg/controller/shared_state.go index 8864e180d6..75f827da72 100644 --- a/pkg/controller/shared_state.go +++ b/pkg/controller/shared_state.go @@ -1099,7 +1099,7 @@ func (c *SharedState) manageReplicas(ctx context.Context, volumeName string) err var azVolume *azdiskv1beta2.AzVolume azVolume, err = azureutils.GetAzVolume(ctx, c.cachedClient, c.azClient, volumeName, c.objectNamespace, true) if apiErrors.IsNotFound(err) { - w.Logger().Info("Volume no longer exists. Aborting manage replica operation") + w.Logger().V(5).Info("Volume no longer exists. Aborting manage replica operation") return nil } else if err != nil { w.Logger().Error(err, "failed to get AzVolume") diff --git a/pkg/provisioner/crdprovisioner.go b/pkg/provisioner/crdprovisioner.go index 282219b127..1597a4b0ae 100644 --- a/pkg/provisioner/crdprovisioner.go +++ b/pkg/provisioner/crdprovisioner.go @@ -321,7 +321,7 @@ func (c *CrdProvisioner) CreateVolume( } // if volume creation was unsuccessful, delete the AzVolume CRI and return error go func() { - w.Logger().Info("Deleting volume due to failed volume creation") + w.Logger().V(5).Info("Deleting volume due to failed volume creation") conditionFunc := func() (bool, error) { if err := azVolumeClient.Delete(context.Background(), azVolumeName, metav1.DeleteOptions{}); err != nil && !apiErrors.IsNotFound(err) { w.Logger().Error(err, "failed to make a delete request for AzVolume CRI") @@ -369,7 +369,7 @@ func (c *CrdProvisioner) DeleteVolume(ctx context.Context, volumeID string, secr if err != nil { if apiErrors.IsNotFound(err) { - w.Logger().Logger.WithValues(consts.VolumeNameLabel, volumeName).Info("Deletion successful: could not find the AzVolume CRI") + w.Logger().Logger.WithValues(consts.VolumeNameLabel, volumeName).V(5).Info("Deletion successful: could not find the AzVolume CRI") return nil } w.Logger().Logger.WithValues(consts.VolumeNameLabel, volumeName).Error(err, "failed to get AzVolume CRI") @@ -378,7 +378,7 @@ func (c *CrdProvisioner) DeleteVolume(ctx context.Context, volumeID string, secr // we don't want to delete pre-provisioned volumes if azureutils.MapContains(azVolumeInstance.Status.Annotations, consts.PreProvisionedVolumeAnnotation) { - w.Logger().Info("AzVolume is pre-provisioned and won't be deleted.") + w.Logger().V(5).Info("AzVolume is pre-provisioned and won't be deleted.") return nil } @@ -838,7 +838,7 @@ func (c *CrdProvisioner) UnpublishVolume( if err != nil { if apiErrors.IsNotFound(err) { - w.Logger().WithValues(consts.VolumeNameLabel, volumeName, consts.NodeNameLabel, nodeID).Info("Volume detach successful") + w.Logger().WithValues(consts.VolumeNameLabel, volumeName, consts.NodeNameLabel, nodeID).V(5).Info("Volume detach successful") err = nil return nil }