Skip to content

OCPBUGS-58880,OCPBUGS-56805: fix: clusteroperator: do not update status.relatedobjects if only order changed#331

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
damdo:fix-clusteroperator-status-relatedobject-update-loop
Jul 11, 2025
Merged

OCPBUGS-58880,OCPBUGS-56805: fix: clusteroperator: do not update status.relatedobjects if only order changed#331
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
damdo:fix-clusteroperator-status-relatedobject-update-loop

Conversation

@damdo
Copy link
Member

@damdo damdo commented Jul 8, 2025

RelatedObjects is a slice of []configv1.ObjectReference the equality.Semantic.DeepEqual() here considers different the ordering on the slice and forces a status update on the ClusterOperator object

Especially considering that the slice is built from looping over a r.Scheme().AllKnownTypes() which is a map

This PR orders the two RelatedObjects sources before the DeepEqual() check, to make sure slices with the same elements in different order, are considered equal, avoiding the update loop.

  • commit 1: implements the fix
  • commit 2: reworks the SyncStatus() to sync the entire status and not only conditions

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 8, 2025
@openshift-ci-robot
Copy link

@damdo: This pull request references Jira Issue OCPBUGS-58880, which is invalid:

  • expected the bug to target the "4.20.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

RelatedObjects is a slice of []configv1.ObjectReference the equality.Semantic.DeepEqual() here considers different the ordering on the slice and forces a status update on the ClusterOperator object

Especially considering that the slice is built from looping over a r.Scheme().AllKnownTypes() which is a map

This PR orders the two RelatedObjects sources before the DeepEqual() check, to make sure slices with the same elements in different order, are considered equal, avoiding the update loop.

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-ci openshift-ci bot requested review from RadekManak and elmiko July 8, 2025 17:03
@damdo
Copy link
Member Author

damdo commented Jul 8, 2025

/assign @sdodson

@sdodson
Copy link
Member

sdodson commented Jul 8, 2025

/label approved
/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jul 8, 2025
@openshift-ci-robot
Copy link

@sdodson: This pull request references Jira Issue OCPBUGS-58880, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

Details

In response to this:

/label approved
/jira refresh

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-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jul 8, 2025
@openshift-ci openshift-ci bot requested a review from sunzhaohua2 July 8, 2025 17:26
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2025
@sdodson
Copy link
Member

sdodson commented Jul 8, 2025

/test unit

@damdo
Copy link
Member Author

damdo commented Jul 8, 2025

/cherry-pick release-4.19

@openshift-cherrypick-robot

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

Details

In response to this:

/cherry-pick release-4.19

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.

@damdo
Copy link
Member Author

damdo commented Jul 8, 2025

/retest

@damdo
Copy link
Member Author

damdo commented Jul 9, 2025

/hold

For more testing

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2025
@damdo damdo force-pushed the fix-clusteroperator-status-relatedobject-update-loop branch 2 times, most recently from 059d637 to 0b019fa Compare July 9, 2025 13:20
@openshift-ci openshift-ci bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2025
damdo added 2 commits July 9, 2025 17:14
making it check against full current vs desired status values and only
patch if there is a relevant change.
@damdo damdo force-pushed the fix-clusteroperator-status-relatedobject-update-loop branch from 0b019fa to ea231d3 Compare July 9, 2025 15:15
@openshift-ci-robot
Copy link

@damdo: This pull request references Jira Issue OCPBUGS-58880, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

Details

In response to this:

RelatedObjects is a slice of []configv1.ObjectReference the equality.Semantic.DeepEqual() here considers different the ordering on the slice and forces a status update on the ClusterOperator object

Especially considering that the slice is built from looping over a r.Scheme().AllKnownTypes() which is a map

This PR orders the two RelatedObjects sources before the DeepEqual() check, to make sure slices with the same elements in different order, are considered equal, avoiding the update loop.

  • commit 1: implements the fix
  • commit 2: reworks the SyncStatus() to sync the entire status and not only conditions

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.

@damdo
Copy link
Member Author

damdo commented Jul 10, 2025

/retest-required

@damdo damdo changed the title OCPBUGS-58880: fix: clusteroperator: do not update status.relatedobjects if only order changed OCPBUGS-58880,OCPBUGS-56805: fix: clusteroperator: do not update status.relatedobjects if only order changed Jul 10, 2025
@openshift-ci-robot
Copy link

@damdo: This pull request references Jira Issue OCPBUGS-58880, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

The bug has been updated to refer to the pull request using the external bug tracker.

This pull request references Jira Issue OCPBUGS-56805, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

RelatedObjects is a slice of []configv1.ObjectReference the equality.Semantic.DeepEqual() here considers different the ordering on the slice and forces a status update on the ClusterOperator object

Especially considering that the slice is built from looping over a r.Scheme().AllKnownTypes() which is a map

This PR orders the two RelatedObjects sources before the DeepEqual() check, to make sure slices with the same elements in different order, are considered equal, avoiding the update loop.

  • commit 1: implements the fix
  • commit 2: reworks the SyncStatus() to sync the entire status and not only conditions

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.

@damdo
Copy link
Member Author

damdo commented Jul 10, 2025

/assign @nrb

/retest-required

@nrb
Copy link
Contributor

nrb commented Jul 10, 2025

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 10, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nrb

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

The pull request process is described here

Details 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 Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2025
@sunzhaohua2
Copy link
Contributor

/label qe-approved

no errors in cluser-capi-operator logs

$ oc -n openshift-cluster-api logs -f cluster-capi-operator-57c8b655b6-8vqzn | grep "Reconciler error" | grep "clusteroperator"                                                    
Defaulted container "cluster-capi-operator" out of: cluster-capi-operator, machine-api-migration
^C

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Jul 11, 2025
@openshift-ci-robot
Copy link

@damdo: This pull request references Jira Issue OCPBUGS-58880, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

This pull request references Jira Issue OCPBUGS-56805, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

Details

In response to this:

RelatedObjects is a slice of []configv1.ObjectReference the equality.Semantic.DeepEqual() here considers different the ordering on the slice and forces a status update on the ClusterOperator object

Especially considering that the slice is built from looping over a r.Scheme().AllKnownTypes() which is a map

This PR orders the two RelatedObjects sources before the DeepEqual() check, to make sure slices with the same elements in different order, are considered equal, avoiding the update loop.

  • commit 1: implements the fix
  • commit 2: reworks the SyncStatus() to sync the entire status and not only conditions

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.

@sunzhaohua2
Copy link
Contributor

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 11, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 694626d and 2 for PR HEAD ea231d3 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 11, 2025

@damdo: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn ea231d3 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@damdo
Copy link
Member Author

damdo commented Jul 11, 2025

Openstack failure is unrelated as the issue has been present in that test for a while now (see). I'll talk to shift stack about it

/override ci/prow/e2e-openstack-ovn-techpreview

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 11, 2025

@damdo: Overrode contexts on behalf of damdo: ci/prow/e2e-openstack-ovn-techpreview

Details

In response to this:

Openstack failure is unrelated as the issue has been present in that test for a while now (see). I'll talk to shift stack about it

/override ci/prow/e2e-openstack-ovn-techpreview

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 89f5a58 into openshift:main Jul 11, 2025
25 of 26 checks passed
@openshift-ci-robot
Copy link

@damdo: Jira Issue OCPBUGS-58880: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-58880 has been moved to the MODIFIED state.

Jira Issue OCPBUGS-56805: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-56805 has been moved to the MODIFIED state.

Details

In response to this:

RelatedObjects is a slice of []configv1.ObjectReference the equality.Semantic.DeepEqual() here considers different the ordering on the slice and forces a status update on the ClusterOperator object

Especially considering that the slice is built from looping over a r.Scheme().AllKnownTypes() which is a map

This PR orders the two RelatedObjects sources before the DeepEqual() check, to make sure slices with the same elements in different order, are considered equal, avoiding the update loop.

  • commit 1: implements the fix
  • commit 2: reworks the SyncStatus() to sync the entire status and not only conditions

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

@damdo: new pull request created: #332

Details

In response to this:

/cherry-pick release-4.19

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.

@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-capi-operator
This PR has been included in build ose-cluster-capi-operator-container-v4.20.0-202507110814.p0.g89f5a58.assembly.stream.el9.
All builds following this will include this PR.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants