Skip to content

Conversation

shajmakh
Copy link
Member

This PR fixes status reporting issues and is a preliminary for adding scheduler informer reporting under status conditions.
please see commits for details.

shajmakh added 3 commits July 29, 2025 17:09
syncNUMASchedulerResources() is constructing the sched status and later
in the reconcile loop this status is overriding the main instance status.
Concerning status conditions, the only situation where the
conditions are not set is on first creation of the scheduler CR,
the rest of the cases the conditions are there but they are continuously
overridden with nil in syncNUMASchedulerResources(). This in turn leads
to updating the conditions in r.updateStatus() whenever it is invoked
regardless of the actual existing conditions.

In this commit, ensure that the original current status is the base of
the new one.

Signed-off-by: Shereen Haj <[email protected]>
The goal of `IsUpdatedNUMAResourceOperator()` is to verify if an
update is needed for the resource status or not. Clarify that by
changing the name of the function to `NUMAResourceOperatorNeedsUpdate()`
so it'll be invoked as `status.NUMAResourceOperatorNeedsUpdate()`.

Signed-off-by: Shereen Haj <[email protected]>
So far updatinf the status was done in every reconcilation iteration
even if the spec fields reflected the same values.

This commits saves a copy of the initial resource status and uses it as
a reference to identify if the resource requires a status update or not
and act accordingly.

Signed-off-by: Shereen Haj <[email protected]>
@openshift-ci openshift-ci bot requested review from mrniranjan and Tal-or July 29, 2025 14:12
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2025
Copy link
Contributor

openshift-ci bot commented Jul 29, 2025

@shajmakh: 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/ci-e2e-compact 558833b link false /test ci-e2e-compact

Full PR test history. Your PR dashboard.

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.

Comment on lines 61 to 70
func NUMAResourcesSchedulerNeedsUpdate(oldStatus, newStatus nropv1.NUMAResourcesSchedulerStatus) bool {
os := oldStatus.DeepCopy()
ns := newStatus.DeepCopy()

resetIncomparableConditionFields(os.Conditions)
resetIncomparableConditionFields(ns.Conditions)

return !reflect.DeepEqual(os, ns)
}

Copy link
Member

Choose a reason for hiding this comment

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

duplicates the function right above

Copy link
Member

Choose a reason for hiding this comment

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

no, different object: scheduler vs operator

@@ -191,6 +192,58 @@ func TestNUMAResourceOperatorNeedsUpdate(t *testing.T) {
}
}

func TestNUMAResourcesSchedulerNeedsUpdate(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

does this add coverage? do we want in the previous commit?

Copy link
Member

Choose a reason for hiding this comment

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

no, different object: scheduler vs operator

Copy link
Member

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

thanks, some questions inside

@ffromani
Copy link
Member

/approve
/lgtm

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

openshift-ci bot commented Jul 30, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani, shajmakh

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-merge-bot openshift-merge-bot bot merged commit 64a17ad into openshift-kni:main Jul 30, 2025
20 of 21 checks passed
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants