Skip to content

Conversation

@mrniranjan
Copy link
Contributor

This PR adds util function to check if Control plane nodes are schedulable and
if so skips Node selector tests

Skip Node selector tests when control plane
nodes are schedulable since this tests primarily adds
and deletes mcp on worker nodes and modifies the performance
profile appropriately. This test is not applicable
when control plane nodes are schedulable and we
are relying on performance profile applied to control plane nodes

Signed-off-by: Niranjan M.R <[email protected]>
@openshift-ci openshift-ci bot requested review from Tal-or and jmencak September 23, 2025 08:18
@mrniranjan mrniranjan changed the title E2E: Add function to check control plane nodes are schedulable. OCPBUGS-62091: E2E: Add function to check control plane nodes are schedulable. Sep 23, 2025
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Sep 23, 2025
@openshift-ci-robot
Copy link
Contributor

@mrniranjan: This pull request references Jira Issue OCPBUGS-62091, 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.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @mrniranjan

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

In response to this:

This PR adds util function to check if Control plane nodes are schedulable and
if so skips Node selector tests

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
Copy link
Contributor

openshift-ci bot commented Sep 23, 2025

@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: mrniranjan.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

@mrniranjan: This pull request references Jira Issue OCPBUGS-62091, 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.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @mrniranjan

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

In response to this:

This PR adds util function to check if Control plane nodes are schedulable and
if so skips Node selector tests

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.

return false, err
}

if len(controlPlaneNodes.Items) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this is the right way. Why not check the cluster configuration?

oc get scheduler cluster -o yaml
check mastersSchedulable

Copy link
Contributor

Choose a reason for hiding this comment

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

that could be the more elegant approach I was hinting :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MarSik @ffromani request to review the latest commit

@mrniranjan
Copy link
Contributor Author

/retest

@mrniranjan mrniranjan force-pushed the check_sched_ctrl_plane branch from 59ba31e to 985a1b6 Compare September 24, 2025 12:51
Copy link
Contributor

@MarSik MarSik left a comment

Choose a reason for hiding this comment

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

/lgtm

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

openshift-ci bot commented Sep 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MarSik, mrniranjan

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 Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 24, 2025
if err := testclient.DataPlaneClient.List(context.TODO(), controlPlaneNodes, &client.ListOptions{LabelSelector: selector}); err != nil {
// Check if the control plane nodes are schedulable, returns true if schedulable else false
func IsControlPlaneSchedulable(ctx context.Context) (bool, error) {
cfg, err := testclient.GetRestConfigFromClient(testclient.Client)
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this config needed? can't this be done using simple client Get():

scheduler := &configv1.Scheduler{}
				Expect(testclient.DataPlaneClient.Get(ctx, client.ObjectKey{Name: "cluster"}, scheduler)).ToNot(HaveOccurred())
				return scheduler.Spec.mastersSchedulable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shajmakh
Because we are adding mastersSchedulable to true in "cluster" resource. and the API to fetch this information is available using "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" which requires rest client

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shajmakh
scheduler := &configv1.Scheduler{} ,
this is not possible, We can access scheduler after we create a new variable of configv1 struct

openshiftConfigClient := clientconfigv1.NewForConfigOrDie(<rest config>)
openshiftConfigClient.Schedulers().Get

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 24, 2025
@mrniranjan
Copy link
Contributor Author

@MarSik did some minor changes, Could you review again

@mrniranjan
Copy link
Contributor Author

/retest

Copy link
Contributor

@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.

/lgtm

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

/test okd-scos-e2e-aws-ovn

@mrniranjan
Copy link
Contributor Author

/verified by @mrniranjan

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Sep 25, 2025
@openshift-ci-robot
Copy link
Contributor

@mrniranjan: This PR has been marked as verified by @mrniranjan.

In response to this:

/verified by @mrniranjan

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-merge-bot openshift-merge-bot bot merged commit b5d66f8 into openshift:main Sep 25, 2025
18 of 19 checks passed
@openshift-ci-robot
Copy link
Contributor

@mrniranjan: Jira Issue Verification Checks: Jira Issue OCPBUGS-62091
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-62091 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

In response to this:

This PR adds util function to check if Control plane nodes are schedulable and
if so skips Node selector tests

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.

@mrniranjan
Copy link
Contributor Author

/cherry-pick release-4.20

@openshift-cherrypick-robot

@mrniranjan: new pull request created: #1398

In response to this:

/cherry-pick release-4.20

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-robot
Copy link
Contributor

Fix included in accepted release 4.21.0-0.nightly-2025-09-27-045323

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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants