Skip to content

Common controller doesn't requeue on pvc finalizer remove err #957

@akalenyu

Description

@akalenyu

What happened:
The common snapshot controller will not requeue if intermittent errors prevent the removal of the PVC finalizer, such as

E1109 05:15:43.755196       1 snapshot_controller.go:191] error check and remove PVC finalizer for snapshot [datasource-test-63c30e708034]: snapshot controller failed to update datasource-test-63c30e708034 on API server: Operation cannot be fulfilled on persistentvolumeclaims "datasource-test-63c30e708034": the object has been modified; please apply your changes to the latest version and try again

The relevant code bit

// Check if we should remove finalizer on PVC and remove it if we can.
if err := ctrl.checkandRemovePVCFinalizer(snapshot, false); err != nil {
klog.Errorf("error check and remove PVC finalizer for snapshot [%s]: %v", snapshot.Name, err)
// Log an event and keep the original error from checkandRemovePVCFinalizer
ctrl.eventRecorder.Event(snapshot, v1.EventTypeWarning, "ErrorPVCFinalizer", "Error check and remove PVC Finalizer for VolumeSnapshot")
}
Suggests we are indeed missing an error return. Is this intended?

What you expected to happen:
Finalizer removed

How to reproduce it:
Unit test is sufficient - inject an error to PVC Update() and observe that the controller doesn't return err/requeue

Anything else we need to know?:

Environment:
main branch of external-snapshotter

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions