Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor PVC controller #662

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

black-dragon74
Copy link
Member

This PR refactors the PVC controller to reduce
code duplication by extracting common logic
into its own functions/packages

@black-dragon74
Copy link
Member Author

findChildCronJobs is still duplicated. Generalizing it would require heavy use of reflections. Should I go ahead and include it as well?

Comment on lines 164 to 174
if cap == relciamSpaceOp {
driverAnnotation = rsCSIAddonsDriverAnnotation
}

ok := r.supportsReclaimSpace(driver)
if reclaimSpaceSupportedByDriver && !ok {
logger.Info("Driver supports spacereclamation but driver is not registered in the connection pool, Reqeueing request", "DriverName", driver)
return true, false
if cap == keyRotationOp {
driverAnnotation = krCSIAddonsDriverAnnotation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to switch case

var driverAnnotation string
	switch cap {
	case relciamSpaceOp:
		driverAnnotation = rsCSIAddonsDriverAnnotation
	case keyRotationOp:
		driverAnnotation = krCSIAddonsDriverAnnotation
	default:
		logger.Info(fmt.Sprintf("Invalid capability: %s", cap))
		return false, false
	}

logger *logr.Logger,
annotations map[string]string,
driverName string,
cap string) (bool, bool) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define a type for cap and pass it

// Define a custom type for capabilities
type Capability string

// Define constants for the different capabilities
const (
	ReclaimSpaceOp Capability = "ReclaimSpace"
	KeyRotationOp  Capability = "KeyRotation"
)

RetryDeadlineSeconds: defaultRetryDeadlineSeconds,

switch jobtype {
case relciamSpaceOp:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define Type for it and use it

limitations under the License.
*/

package util
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we dont need a helper file for it, this are common to PVC controller and not used outside by others, add this as functions to PVC controller only

Copy link
Member

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you please do test this out and see nothing breaks

Copy link
Member

@Rakshith-R Rakshith-R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left 2 comments.
@iPraveenParihar can you check the indexer and eventhandler parts.

Comment on lines 251 to 259
if annotationKey == krcJobScheduleTimeAnnotation {
requeue, keyRotationSupported := r.checkDriverSupportsEncryptionKeyRotate(logger, ns.Annotations, driverName)
requeue, keyRotationSupported := r.checkDriverSupportCapability(logger, ns.Annotations, driverName, keyRotationOp)
if keyRotationSupported {
return schedule, nil
}
if requeue {
return "", ErrConnNotFoundRequeueNeeded
}
} else if annotationKey == rsCronJobScheduleTimeAnnotation {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use switch case for annotationKey ?

@@ -521,35 +492,63 @@ func getScheduleFromAnnotation(
return schedule, true
}

// constructRSCronJob constructs and returns ReclaimSpaceCronJob.
func constructRSCronJob(name, namespace, schedule, pvcName string) *csiaddonsv1alpha1.ReclaimSpaceCronJob {
func constructCronJob(jobtype Operation, name, namespace, schedule, pvcName string) client.Object {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write two different contruct[KR|RS]CronJob functions.
It's better to avoid unsafe typecasting.

case keyRotationOp:
driverAnnotation = krCSIAddonsDriverAnnotation
default:
logger.Info("Unknown capability", "Capability", cap)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be Unknown operation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We check for capability inside this function. The reason constants are called Operation and not Capability is to avoid ambiguity with CSI's Capability struct.

@black-dragon74
Copy link
Member Author

black-dragon74 commented Sep 11, 2024

Testing

Logs (annotating PVC)

❯ oc -n csi-addons-system logs -f --tail 0 po/csi-addons-controller-manager-68f5464458-9xf96
2024-09-11T08:09:59.131Z        INFO    Adding keyrotation annotation to the pvc        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "d99931df-f759-4582-849f-66e5fcd7458a", "KeyRotationSchedule": "*/2 * * * *", "annotation": "{\"metadata\":{\"annotations\":{\"keyrotation.csiaddons.openshift.io/cronjob\":\"rbd-pvc-1726042199\",\"keyrotation.csiaddons.openshift.io/schedule\":\"*/2 * * * *\"}}}"}
2024-09-11T08:09:59.169Z        INFO    successfully created new encryptionkeyrotationcronjob   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "d99931df-f759-4582-849f-66e5fcd7458a", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T08:09:59.170Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "d99931df-f759-4582-849f-66e5fcd7458a", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T08:09:59.200Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726042199","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199", "reconcileID": "60b6d9e8-d1e6-4658-aed5-c9c78d3bd358", "now": "2024-09-11T08:09:59.199Z", "nextRun": "2024-09-11T08:10:00.000Z"}
2024-09-11T08:09:59.200Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "0d91b254-0692-4d40-bb02-e561a8c1787b", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726042199", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T08:09:59.224Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726042199","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199", "reconcileID": "a9d9b5e0-c16a-4642-a9e1-8d6fa44f0899", "now": "2024-09-11T08:09:59.224Z", "nextRun": "2024-09-11T08:10:00.000Z"}
2024-09-11T08:09:59.231Z        INFO    successfully updated encryptionkeyrotationcronjob       {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "7a5956db-515a-4b55-a9f7-8ec9562ee520", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726042199", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T08:09:59.231Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "7a5956db-515a-4b55-a9f7-8ec9562ee520", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726042199", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T08:10:00.037Z        INFO    successfully created encryptionkeyrotationjob resource  {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726042199","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199", "reconcileID": "7fb39744-e115-4e90-a0fd-665441f972bc", "now": "2024-09-11T08:10:00.022Z", "nextRun": "2024-09-11T08:12:00.000Z", "currentRun": "2024-09-11T08:10:00.000Z", "encryptionkeyrotationjob": "rbd-pvc-1726042199-1726042200"}
2024-09-11T08:10:00.040Z        INFO    calling encryptionkeyrotation grpc in sidecar   {"controller": "encryptionkeyrotationjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationJob", "EncryptionKeyRotationJob": {"name":"rbd-pvc-1726042199-1726042200","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199-1726042200", "reconcileID": "ab36a979-8c07-4f55-b69a-001f7d4f20a0", "PVCName": "rbd-pvc", "PVCNamespace": "rook-ceph", "PVName": "pvc-f6fbae78-636d-4bc0-90fc-5e071102abcb", "NodeID": "minikube", "Timeout": "3m0s", "nodeClient": "rook-ceph/csi-rbdplugin-rj5h5"}
2024-09-11T08:10:00.063Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726042199","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199", "reconcileID": "7e85ec14-c099-4417-a7e4-fbd867d5f8d2", "now": "2024-09-11T08:10:00.063Z", "nextRun": "2024-09-11T08:12:00.000Z"}
2024-09-11T08:10:00.083Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726042199","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199", "reconcileID": "3bc8671e-ed75-41fb-b5ad-c86ad607bd9b", "now": "2024-09-11T08:10:00.083Z", "nextRun": "2024-09-11T08:12:00.000Z"}
========|
2024-09-11T08:10:33.247Z        INFO    Successfully completed key rotation operation   {"controller": "encryptionkeyrotationjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationJob", "EncryptionKeyRotationJob": {"name":"rbd-pvc-1726042199-1726042200","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199-1726042200", "reconcileID": "ab36a979-8c07-4f55-b69a-001f7d4f20a0", "PVCName": "rbd-pvc", "PVCNamespace": "rook-ceph", "PVName": "pvc-f6fbae78-636d-4bc0-90fc-5e071102abcb", "NodeID": "minikube", "Timeout": "3m0s", "nodeClient": "rook-ceph/csi-rbdplugin-rj5h5"}
2024-09-11T08:10:33.289Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726042199","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199", "reconcileID": "620574f1-b346-4ce6-98ca-04d0731961e8", "now": "2024-09-11T08:10:33.289Z", "nextRun": "2024-09-11T08:12:00.000Z"}
2024-09-11T08:10:33.301Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726042199","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042199", "reconcileID": "e88ff5f3-688f-4961-932b-1f5c10fc57c2", "now": "2024-09-11T08:10:33.301Z", "nextRun": "2024-09-11T08:12:00.000Z"}
========|
        Reclaim Space
========|
2024-09-11T08:14:16.235Z        INFO    annotation not found for key rotation, exiting reconcile        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "c357a936-5bca-4e5a-ab47-c5f0c1f6683f"}
2024-09-11T08:14:16.236Z        INFO    Adding annotation       {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "c357a936-5bca-4e5a-ab47-c5f0c1f6683f", "Schedule": "*/2 * * * *", "ReclaimSpaceCronJobName": "rbd-pvc-1726042456", "Annotation": "{\"metadata\":{\"annotations\":{\"reclaimspace.csiaddons.openshift.io/cronjob\":\"rbd-pvc-1726042456\",\"reclaimspace.csiaddons.openshift.io/schedule\":\"*/2 * * * *\"}}}"}
2024-09-11T08:14:16.271Z        INFO    Successfully created reclaimSpaceCronJob        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "c357a936-5bca-4e5a-ab47-c5f0c1f6683f", "Schedule": "*/2 * * * *", "ReclaimSpaceCronJobName": "rbd-pvc-1726042456"}
2024-09-11T08:14:16.273Z        INFO    annotation not found for key rotation, exiting reconcile        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "28b912b1-2387-48e8-b0bf-af21dda0e94d"}
2024-09-11T08:14:16.294Z        INFO    No upcoming scheduled times, requeue with delay till next run   {"controller": "reclaimspacecronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "ReclaimSpaceCronJob", "ReclaimSpaceCronJob": {"name":"rbd-pvc-1726042456","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042456", "reconcileID": "0d082f71-41ef-4846-8435-d194b08878dc", "now": "2024-09-11T08:14:16.294Z", "nextRun": "2024-09-11T08:16:00.000Z"}
2024-09-11T08:14:16.321Z        INFO    No upcoming scheduled times, requeue with delay till next run   {"controller": "reclaimspacecronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "ReclaimSpaceCronJob", "ReclaimSpaceCronJob": {"name":"rbd-pvc-1726042456","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042456", "reconcileID": "d006a8f4-75df-4e18-aa5d-8894718e1c92", "now": "2024-09-11T08:14:16.321Z", "nextRun": "2024-09-11T08:16:00.000Z"}
2024-09-11T08:14:16.328Z        INFO    annotation not found for key rotation, exiting reconcile        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "54513970-853e-44ce-9b08-39698220f7a2"}
2024-09-11T08:14:16.344Z        INFO    Successfully updated reclaimSpaceCronJob        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "54513970-853e-44ce-9b08-39698220f7a2", "ReclaimSpaceCronJobName": "rbd-pvc-1726042456", "Schedule": "*/2 * * * *"}
2024-09-11T08:16:00.026Z        INFO    Successfully created reclaimSpaceJob for reclaimSpaceCronJob run        {"controller": "reclaimspacecronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "ReclaimSpaceCronJob", "ReclaimSpaceCronJob": {"name":"rbd-pvc-1726042456","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042456", "reconcileID": "7510c703-8384-4579-b0b8-7c8483e7cd1c", "now": "2024-09-11T08:16:00.010Z", "nextRun": "2024-09-11T08:18:00.000Z", "currentRun": "2024-09-11T08:16:00.000Z", "reclaimSpacejob": "rbd-pvc-1726042456-1726042560"}
2024-09-11T08:16:00.029Z        INFO    Making node reclaim space request       {"controller": "reclaimspacejob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "ReclaimSpaceJob", "ReclaimSpaceJob": {"name":"rbd-pvc-1726042456-1726042560","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042456-1726042560", "reconcileID": "40d832af-a501-4b2f-bd4a-f8436e43b630", "PVCName": "rbd-pvc", "PVCNamespace": "rook-ceph", "PVName": "pvc-f6fbae78-636d-4bc0-90fc-5e071102abcb", "NodeID": "minikube", "Timeout": "3m0s", "nodeClient": "rook-ceph/csi-rbdplugin-rj5h5"}
2024-09-11T08:16:00.044Z        INFO    No upcoming scheduled times, requeue with delay till next run   {"controller": "reclaimspacecronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "ReclaimSpaceCronJob", "ReclaimSpaceCronJob": {"name":"rbd-pvc-1726042456","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042456", "reconcileID": "568b2058-0ddc-4617-b5b5-de4f89e50d1c", "now": "2024-09-11T08:16:00.044Z", "nextRun": "2024-09-11T08:18:00.000Z"}
2024-09-11T08:16:00.057Z        INFO    No upcoming scheduled times, requeue with delay till next run   {"controller": "reclaimspacecronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "ReclaimSpaceCronJob", "ReclaimSpaceCronJob": {"name":"rbd-pvc-1726042456","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042456", "reconcileID": "a425d653-abce-4717-a166-c9cc6524d1dc", "now": "2024-09-11T08:16:00.057Z", "nextRun": "2024-09-11T08:18:00.000Z"}
========|
2024-09-11T08:16:00.139Z        ERROR   Failed to make node request     {"controller": "reclaimspacejob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "ReclaimSpaceJob", "ReclaimSpaceJob": {"name":"rbd-pvc-1726042456-1726042560","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726042456-1726042560", "reconcileID": "40d832af-a501-4b2f-bd4a-f8436e43b630", "PVCName": "rbd-pvc", "PVCNamespace": "rook-ceph", "PVName": "pvc-f6fbae78-636d-4bc0-90fc-5e071102abcb", "NodeID": "minikube", "Timeout": "3m0s", "nodeClient": "rook-ceph/csi-rbdplugin-rj5h5", "error": "rpc error: code = Internal desc = failed to execute \"fstrim\" on \"/var/lib/kubelet/plugins/kubernetes.io/csi/rook-ceph.rbd.csi.ceph.com/b8b0c8b96aaec257fb56459ed1a7065a194484ccef6a21323ef11d0c216240b7/globalmount/0001-0009-rook-ceph-0000000000000002-bc5d01e5-acf0-4380-be33-57ccee8674d2\" (an error (exit status 1) occurred while running fstrim args: [/var/lib/kubelet/plugins/kubernetes.io/csi/rook-ceph.rbd.csi.ceph.com/b8b0c8b96aaec257fb56459ed1a7065a194484ccef6a21323ef11d0c216240b7/globalmount/0001-0009-rook-ceph-0000000000000002-bc5d01e5-acf0-4380-be33-57ccee8674d2]): fstrim: /var/lib/kubelet/plugins/kubernetes.io/csi/rook-ceph.rbd.csi.ceph.com/b8b0c8b96aaec257fb56459ed1a7065a194484ccef6a21323ef11d0c216240b7/globalmount/0001-0009-rook-ceph-0000000000000002-bc5d01e5-acf0-4380-be33-57ccee8674d2: the discard operation is not supported\n"}

Note: The relcaim-space error is related to fstrim discard op not being supported (unrelated to csi-addons-controller)

Logs (annotating SC)

❯ oc -n csi-addons-system logs -f --tail 0 po/csi-addons-controller-manager-68f5464458-695jv
// Annotate SC
2024-09-11T10:24:31.357Z        INFO    Adding keyrotation annotation to the pvc        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "9805ade2-b85e-4be9-bff4-09abf3172a6e", "KeyRotationSchedule": "*/2 * * * *", "annotation": "{\"metadata\":{\"annotations\":{\"keyrotation.csiaddons.openshift.io/cronjob\":\"rbd-pvc-1726050271\",\"keyrotation.csiaddons.openshift.io/schedule\":\"*/2 * * * *\"}}}"}
2024-09-11T10:24:31.425Z        INFO    successfully created new encryptionkeyrotationcronjob   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "9805ade2-b85e-4be9-bff4-09abf3172a6e", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T10:24:31.431Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "9805ade2-b85e-4be9-bff4-09abf3172a6e", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T10:24:31.445Z        INFO    successfully updated encryptionkeyrotationcronjob       {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "6d259ed3-a42e-41ab-8757-b3e99181866c", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726050271", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T10:24:31.446Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "6d259ed3-a42e-41ab-8757-b3e99181866c", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726050271", "KeyRotationSchedule": "*/2 * * * *"}
2024-09-11T10:24:31.454Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "7d21bb4e-43f6-4e6b-8f7e-01f98852233d", "now": "2024-09-11T10:24:31.454Z", "nextRun": "2024-09-11T10:26:00.000Z"}
2024-09-11T10:24:31.468Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "6933c74e-5bf2-418b-a349-297f08a5d721", "now": "2024-09-11T10:24:31.468Z", "nextRun": "2024-09-11T10:26:00.000Z"}
===
2024-09-11T10:26:00.025Z        INFO    successfully created encryptionkeyrotationjob resource  {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "bd716418-b5b7-4927-ae10-c31cd3c736ed", "now": "2024-09-11T10:26:00.011Z", "nextRun": "2024-09-11T10:28:00.000Z", "currentRun": "2024-09-11T10:26:00.000Z", "encryptionkeyrotationjob": "rbd-pvc-1726050271-1726050360"}
2024-09-11T10:26:00.047Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "0e41cc34-8afa-4ece-b911-db2cb724b664", "now": "2024-09-11T10:26:00.047Z", "nextRun": "2024-09-11T10:28:00.000Z"}
2024-09-11T10:26:00.060Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "792b1c9c-5920-4bbc-ac38-dbaa791ab7e7", "now": "2024-09-11T10:26:00.060Z", "nextRun": "2024-09-11T10:28:00.000Z"}
2024-09-11T10:26:00.133Z        INFO    calling encryptionkeyrotation grpc in sidecar   {"controller": "encryptionkeyrotationjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationJob", "EncryptionKeyRotationJob": {"name":"rbd-pvc-1726050271-1726050360","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271-1726050360", "reconcileID": "acff6580-902e-4078-975d-e645df8b01d0", "PVCName": "rbd-pvc", "PVCNamespace": "rook-ceph", "PVName": "pvc-6d688317-1358-44c3-86dc-df853c6be7c2", "NodeID": "minikube", "Timeout": "3m0s", "nodeClient": "rook-ceph/csi-rbdplugin-vvqw5"}
2024-09-11T10:26:40.031Z        INFO    Successfully completed key rotation operation   {"controller": "encryptionkeyrotationjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationJob", "EncryptionKeyRotationJob": {"name":"rbd-pvc-1726050271-1726050360","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271-1726050360", "reconcileID": "acff6580-902e-4078-975d-e645df8b01d0", "PVCName": "rbd-pvc", "PVCNamespace": "rook-ceph", "PVName": "pvc-6d688317-1358-44c3-86dc-df853c6be7c2", "NodeID": "minikube", "Timeout": "3m0s", "nodeClient": "rook-ceph/csi-rbdplugin-vvqw5"}
2024-09-11T10:26:40.093Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "61814ff5-d8bd-45cd-b508-959d15469825", "now": "2024-09-11T10:26:40.093Z", "nextRun": "2024-09-11T10:28:00.000Z"}
2024-09-11T10:26:40.115Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "ab8de6d9-0dc3-49fc-83ee-dfe1ef686254", "now": "2024-09-11T10:26:40.115Z", "nextRun": "2024-09-11T10:28:00.000Z"}

// Delete annotation from PVC
2024-09-11T10:29:05.959Z        INFO    annotation not found for key rotation, exiting reconcile        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "2d735d43-4ed2-4be6-a8fe-5679ad006ede", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726050271"}
2024-09-11T10:29:05.960Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "2d735d43-4ed2-4be6-a8fe-5679ad006ede", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726050271"}
2024-09-11T10:29:05.960Z        INFO    encryptionkeyrotationcronjob resource not found {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "a78b9bd1-c09d-4e3d-9fb5-1ed984b6dbd7"}
2024-09-11T10:29:05.962Z        INFO    annotation not found for key rotation, exiting reconcile        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "efd8f97d-44ef-4d7f-860e-d5469030e7a2"}
2024-09-11T10:29:05.962Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "efd8f97d-44ef-4d7f-860e-d5469030e7a2"}
2024-09-11T10:29:06.014Z        INFO    encryptionkeyrotationcronjob resource not found {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "767e6291-f488-4d70-ac07-975fcb1c6be7"}
2024-09-11T10:29:06.015Z        INFO    encryptionkeyrotationjob resource not found     {"controller": "encryptionkeyrotationjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationJob", "EncryptionKeyRotationJob": {"name":"rbd-pvc-1726050271-1726050360","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271-1726050360", "reconcileID": "b28e2d37-8047-4c31-b829-51f8a0571d51"}
2024-09-11T10:29:06.020Z        INFO    encryptionkeyrotationcronjob resource not found {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "30d6bba2-226d-4fc7-83eb-90cc26e29ee8"}
2024-09-11T10:29:06.021Z        INFO    encryptionkeyrotationjob resource not found     {"controller": "encryptionkeyrotationjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationJob", "EncryptionKeyRotationJob": {"name":"rbd-pvc-1726050271-1726050480","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271-1726050480", "reconcileID": "f248cc41-6169-4d4e-a13d-ba814fb69eec"}

// Update annotation on SC
2024-09-11T10:29:38.861Z        INFO    Adding keyrotation annotation to the pvc        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "203e7722-290d-4759-a967-47c388009e2d", "KeyRotationSchedule": "*/5 * * * *", "annotation": "{\"metadata\":{\"annotations\":{\"keyrotation.csiaddons.openshift.io/cronjob\":\"rbd-pvc-1726050578\",\"keyrotation.csiaddons.openshift.io/schedule\":\"*/5 * * * *\"}}}"}
2024-09-11T10:29:38.896Z        INFO    successfully created new encryptionkeyrotationcronjob   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "203e7722-290d-4759-a967-47c388009e2d", "KeyRotationSchedule": "*/5 * * * *"}
2024-09-11T10:29:38.896Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "203e7722-290d-4759-a967-47c388009e2d", "KeyRotationSchedule": "*/5 * * * *"}
2024-09-11T10:29:38.896Z        INFO    Adding keyrotation annotation to the pvc        {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "60fbb6f0-7101-4fa1-9fd9-2439bf8389a9", "KeyRotationSchedule": "*/5 * * * *", "annotation": "{\"metadata\":{\"annotations\":{\"keyrotation.csiaddons.openshift.io/cronjob\":\"rbd-pvc-1726050578\",\"keyrotation.csiaddons.openshift.io/schedule\":\"*/5 * * * *\"}}}"}
2024-09-11T10:29:38.914Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050578","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578", "reconcileID": "2b981df7-8073-4337-8efa-ad144589fa22", "now": "2024-09-11T10:29:38.914Z", "nextRun": "2024-09-11T10:30:00.000Z"}
2024-09-11T10:29:38.927Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "60fbb6f0-7101-4fa1-9fd9-2439bf8389a9", "KeyRotationSchedule": "*/5 * * * *"}
2024-09-11T10:29:38.936Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050578","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578", "reconcileID": "cc292948-fc84-4c11-99da-3dec3a0345e9", "now": "2024-09-11T10:29:38.936Z", "nextRun": "2024-09-11T10:30:00.000Z"}
2024-09-11T10:29:38.945Z        INFO    successfully updated encryptionkeyrotationcronjob       {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "8285de5f-7f48-4016-80d2-00963bc0fcc5", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726050578", "KeyRotationSchedule": "*/5 * * * *"}
2024-09-11T10:29:38.945Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "8285de5f-7f48-4016-80d2-00963bc0fcc5", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726050578", "KeyRotationSchedule": "*/5 * * * *"}
2024-09-11T10:29:38.962Z        INFO    successfully updated encryptionkeyrotationcronjob       {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "5ab47b73-0cde-4cb9-9ac3-c0eee5e6700a", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726050578", "KeyRotationSchedule": "*/5 * * * *"}
2024-09-11T10:29:38.962Z        INFO    Annotation not set, exiting reconcile   {"controller": "persistentvolumeclaim", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "PersistentVolumeClaim": {"name":"rbd-pvc","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc", "reconcileID": "5ab47b73-0cde-4cb9-9ac3-c0eee5e6700a", "EncryptionKeyrotationCronJobName": "rbd-pvc-1726050578", "KeyRotationSchedule": "*/5 * * * *"}
===
2024-09-11T10:30:00.012Z        INFO    encryptionkeyrotationcronjob resource not found {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050271","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050271", "reconcileID": "c142f8c6-766c-4437-98d8-5739a9ea8c7d"}
2024-09-11T10:30:00.076Z        INFO    successfully created encryptionkeyrotationjob resource  {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050578","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578", "reconcileID": "8be75b67-73d1-4fa5-8a20-3ed1e2727543", "now": "2024-09-11T10:30:00.046Z", "nextRun": "2024-09-11T10:35:00.000Z", "currentRun": "2024-09-11T10:30:00.000Z", "encryptionkeyrotationjob": "rbd-pvc-1726050578-1726050600"}
2024-09-11T10:30:00.085Z        INFO    calling encryptionkeyrotation grpc in sidecar   {"controller": "encryptionkeyrotationjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationJob", "EncryptionKeyRotationJob": {"name":"rbd-pvc-1726050578-1726050600","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578-1726050600", "reconcileID": "a9543359-36ae-496e-9baf-1fa097e973a5", "PVCName": "rbd-pvc", "PVCNamespace": "rook-ceph", "PVName": "pvc-6d688317-1358-44c3-86dc-df853c6be7c2", "NodeID": "minikube", "Timeout": "3m0s", "nodeClient": "rook-ceph/csi-rbdplugin-vvqw5"}
2024-09-11T10:30:00.109Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050578","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578", "reconcileID": "0197e6e2-8286-4bd1-a781-4858c4b92ea1", "now": "2024-09-11T10:30:00.109Z", "nextRun": "2024-09-11T10:35:00.000Z"}
2024-09-11T10:30:00.154Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050578","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578", "reconcileID": "9264d819-730e-4d55-8093-7a11e027a671", "now": "2024-09-11T10:30:00.154Z", "nextRun": "2024-09-11T10:35:00.000Z"}
2024-09-11T10:30:32.519Z        INFO    Successfully completed key rotation operation   {"controller": "encryptionkeyrotationjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationJob", "EncryptionKeyRotationJob": {"name":"rbd-pvc-1726050578-1726050600","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578-1726050600", "reconcileID": "a9543359-36ae-496e-9baf-1fa097e973a5", "PVCName": "rbd-pvc", "PVCNamespace": "rook-ceph", "PVName": "pvc-6d688317-1358-44c3-86dc-df853c6be7c2", "NodeID": "minikube", "Timeout": "3m0s", "nodeClient": "rook-ceph/csi-rbdplugin-vvqw5"}
2024-09-11T10:30:32.554Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050578","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578", "reconcileID": "9c3062ab-3673-40e8-9206-db7c1a5675e7", "now": "2024-09-11T10:30:32.554Z", "nextRun": "2024-09-11T10:35:00.000Z"}
2024-09-11T10:30:32.566Z        INFO    no upcoming schedule, requeue with delay until next run {"controller": "encryptionkeyrotationcronjob", "controllerGroup": "csiaddons.openshift.io", "controllerKind": "EncryptionKeyRotationCronJob", "EncryptionKeyRotationCronJob": {"name":"rbd-pvc-1726050578","namespace":"rook-ceph"}, "namespace": "rook-ceph", "name": "rbd-pvc-1726050578", "reconcileID": "abb4957e-082f-418c-a266-2565331ab0e0", "now": "2024-09-11T10:30:32.566Z", "nextRun": "2024-09-11T10:35:00.000Z"}

@black-dragon74
Copy link
Member Author

LGTM, can you please do test this out and see nothing breaks

I have updated the PR with logs.

Copy link
Member

@iPraveenParihar iPraveenParihar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, has the testing done for all scenarios?

@black-dragon74
Copy link
Member Author

LGTM, has the testing done for all scenarios?

I’ll be updating above comment with logs for other scenarios shortly.

Madhu-1
Madhu-1 previously approved these changes Sep 12, 2024
@black-dragon74
Copy link
Member Author

@Rakshith-R PTAL at this one again when you can?

Copy link
Member

@Rakshith-R Rakshith-R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more change.

Comment on lines +196 to +198
if capFound {
return false, true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to check capFound in below lines.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Here's a diff of the latest change for ease of review:

-       if driverSupportsCap && !capFound {
-               logger.Info(fmt.Sprintf("Driver supports %s but driver is not registered in the connection pool, Reqeueing request", cap), "DriverName", driverName)
+       // If the driver supports the capability but the capability is not found in connection pool,
+       if driverSupportsCap {
+               logger.Info(fmt.Sprintf("Driver supports %s but driver is not registered in the connection pool, Requeuing request", cap), "DriverName", driverName)
                return true, false
        }

-       if !capFound {
-               logger.Info(fmt.Sprintf("Driver does not support %s, skip Requeue", cap), "DriverName", driverName)
-               return false, false
-       }
-
-       // Do not reque, cap is supported
-       return false, true
-
+       // If the driver does not support the capability, skip requeue
+       logger.Info(fmt.Sprintf("Driver does not support %s, skip Requeue", cap), "DriverName", driverName)
+       return false, false
 }

This PR refactors the PVC controller to reduce
code duplication by extracting common logic
into its own functions/packages

Signed-off-by: Niraj Yadav <[email protected]>
@mergify mergify bot merged commit 4464b1e into csi-addons:main Sep 13, 2024
15 checks passed
lumiere-bot bot referenced this pull request in coolguy1771/home-ops Sep 19, 2024
… ) (#5423)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[kubernetes-csi-addons](https://redirect.github.com/csi-addons/kubernetes-csi-addons)
| minor | `v0.9.1` -> `v0.10.0` |

---

### Release Notes

<details>
<summary>csi-addons/kubernetes-csi-addons
(kubernetes-csi-addons)</summary>

###
[`v0.10.0`](https://redirect.github.com/csi-addons/kubernetes-csi-addons/releases/tag/v0.10.0)

[Compare
Source](https://redirect.github.com/csi-addons/kubernetes-csi-addons/compare/v0.9.1...v0.10.0)

#### What's Changed

- Add proto and sidecar code for volumegroup by
[@&#8203;Nikhil-Ladha](https://redirect.github.com/Nikhil-Ladha) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/652](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/652)
- vendor: Bump google.golang.org/grpc from 1.65.0 to 1.66.0 in the
golang-dependencies group by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/656](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/656)
- vendor: Bump sigs.k8s.io/controller-tools from 0.16.1 to 0.16.2 in
/tools in the k8s-dependencies group by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/658](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/658)
- vendor: Bump the github-dependencies group across 1 directory with 3
updates by [@&#8203;dependabot](https://redirect.github.com/dependabot)
in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/657](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/657)
- replication: add new Validated condition by
[@&#8203;Rakshith-R](https://redirect.github.com/Rakshith-R) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/664](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/664)
- bundle: Update CSV capability to Seamless Upgrades by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/668](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/668)
- Refactor PVC controller by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/662](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/662)
- bundle: Add missing CRDs to bundle CSV by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/669](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/669)
- vendor: bump the k8s-dependencies group with 3 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/673](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/673)

#### New Contributors

- [@&#8203;Nikhil-Ladha](https://redirect.github.com/Nikhil-Ladha) made
their first contribution in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/652](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/652)

**Full Changelog**:
csi-addons/kubernetes-csi-addons@v0.9.1...v0.10.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44NS4wIiwidXBkYXRlZEluVmVyIjoiMzguODUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUvZ2l0aHViLXJlbGVhc2UiLCJ0eXBlL21pbm9yIl19-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
spiceratops referenced this pull request in spiceratops/k8s-gitops Sep 26, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[kubernetes-csi-addons](https://redirect.github.com/csi-addons/kubernetes-csi-addons)
| minor | `v0.9.1` -> `v0.10.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>csi-addons/kubernetes-csi-addons
(kubernetes-csi-addons)</summary>

###
[`v0.10.0`](https://redirect.github.com/csi-addons/kubernetes-csi-addons/releases/tag/v0.10.0)

[Compare
Source](https://redirect.github.com/csi-addons/kubernetes-csi-addons/compare/v0.9.1...v0.10.0)

#### What's Changed

- Add proto and sidecar code for volumegroup by
[@&#8203;Nikhil-Ladha](https://redirect.github.com/Nikhil-Ladha) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/652](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/652)
- vendor: Bump google.golang.org/grpc from 1.65.0 to 1.66.0 in the
golang-dependencies group by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/656](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/656)
- vendor: Bump sigs.k8s.io/controller-tools from 0.16.1 to 0.16.2 in
/tools in the k8s-dependencies group by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/658](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/658)
- vendor: Bump the github-dependencies group across 1 directory with 3
updates by [@&#8203;dependabot](https://redirect.github.com/dependabot)
in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/657](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/657)
- replication: add new Validated condition by
[@&#8203;Rakshith-R](https://redirect.github.com/Rakshith-R) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/664](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/664)
- bundle: Update CSV capability to Seamless Upgrades by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/668](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/668)
- Refactor PVC controller by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/662](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/662)
- bundle: Add missing CRDs to bundle CSV by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/669](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/669)
- vendor: bump the k8s-dependencies group with 3 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/673](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/673)

#### New Contributors

- [@&#8203;Nikhil-Ladha](https://redirect.github.com/Nikhil-Ladha) made
their first contribution in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/652](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/652)

**Full Changelog**:
csi-addons/kubernetes-csi-addons@v0.9.1...v0.10.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44NS4wIiwidXBkYXRlZEluVmVyIjoiMzguODUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUvZ2l0aHViLXJlbGVhc2UiLCJ0eXBlL21pbm9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants