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

controllers: use semantic deepequal #289

Merged

Conversation

rewantsoni
Copy link
Member

@rewantsoni rewantsoni commented Dec 4, 2024

The logs for operator had multiple StorageClaims reconcile for rbd type.
The VRC for flatten in rbd didn't have any annotation added to it due to which reflect.DeepEqual was treating it as difference and it was being created again and again. Hence moving to use semantics.DeepQual which treats empty and nil containers the same.

An empty slice *is* equal to a nil slice for our purposes; same for maps.

Ref: https://pkg.go.dev/k8s.io/apimachinery/third_party/forked/golang/reflect#Equalities.DeepEqual

@rewantsoni
Copy link
Member Author

Teesting:
Before:

 "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "8678b122-c7ee-4861-b4f0-2ebfe05d8b6a", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:15:05Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "804879f3-884e-47b9-a497-cbb8ed4180c7", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:15:06Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "b3a023b3-52b3-4d5d-bc72-97661c267662", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:15:06Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "49f193a8-2bac-451d-b292-56511bf50d69", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:15:06Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "b6e12c49-a4b0-47f5-aa20-1e30b89dd97c", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:15:07Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "25ac4289-f776-407e-8ef0-694c006045ae", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:15:07Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "5244e0a9-4530-4c58-b930-7b365c24ac6d", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:15:07Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "b3051662-1fe2-47cd-a8de-0c148d23ec1b", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:15:08Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "c75fca55-ad0e-4a9b-be4a-4db4a06a3f47", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}

After:

[rewantsoni scripts] k logs ocs-client-operator-controller-manager-58f849c46c-5w2bp | grep StorageClaim
2024-12-04T04:18:25Z    INFO    Starting EventSource    {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "source": "kind source: *v1alpha1.StorageClaim"}
2024-12-04T04:18:25Z    INFO    Starting EventSource    {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "source": "kind source: *v1.StorageClass"}
2024-12-04T04:18:25Z    INFO    Starting EventSource    {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "source": "kind source: *v1.VolumeSnapshotClass"}
2024-12-04T04:18:25Z    INFO    Starting EventSource    {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "source": "kind source: *v1alpha1.VolumeReplicationClass"}
2024-12-04T04:18:25Z    INFO    Starting EventSource    {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "source": "kind source: *v1alpha1.ClientProfile"}
2024-12-04T04:18:25Z    INFO    Starting Controller     {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim"}
2024-12-04T04:18:25Z    INFO    Starting EventSource    {"controller": "storageclient", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClient", "source": "kind source: *v1alpha1.StorageClaim"}
2024-12-04T04:18:25Z    INFO    Starting EventSource    {"controller": "MaintenanceMode", "source": "kind source: *v1alpha1.StorageClaim"}
2024-12-04T04:18:26Z    INFO    Starting workers        {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "worker count": 1}
2024-12-04T04:18:26Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}, "namespace": "", "name": "ocs-storagecluster-ceph-rbd", "reconcileID": "f4b14794-1a95-4e42-819a-6d408268544b", "StorageClaim": {"name":"ocs-storagecluster-ceph-rbd"}}
2024-12-04T04:18:26Z    INFO    Reconciling StorageClaim.       {"controller": "storageclaim", "controllerGroup": "ocs.openshift.io", "controllerKind": "StorageClaim", "StorageClaim": {"name":"ocs-storagecluster-cephfs"}, "namespace": "", "name": "ocs-storagecluster-cephfs", "reconcileID": "2c638be1-16c8-4707-95b9-b7442b9083d3", "StorageClaim": {"name":"ocs-storagecluster-cephfs"}}

@rewantsoni
Copy link
Member Author

/jira backport release-4.18

@openshift-ci-robot
Copy link

@rewantsoni: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.18

In response to this:

/jira backport release-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-cherrypick-robot

@openshift-ci-robot: once the present PR merges, I will cherry-pick it on top of release-4.18 in a new PR and assign it to you.

In response to this:

@rewantsoni: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.18

In response to this:

/jira backport release-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Contributor

@leelavg leelavg left a comment

Choose a reason for hiding this comment

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

thanks a lot for debugging and fixing this!

Copy link

openshift-ci bot commented Dec 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leelavg, rewantsoni

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Dec 4, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 3bfb808 into red-hat-storage:main Dec 4, 2024
11 checks passed
@openshift-cherrypick-robot

@openshift-ci-robot: new pull request created: #290

In response to this:

@rewantsoni: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.18

In response to this:

/jira backport release-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants