Skip to content

Conversation

@kyrtapz
Copy link
Contributor

@kyrtapz kyrtapz commented Oct 9, 2025

When a node is removed, the controller would retry indefinitely instead of setting an appropriate error condition. Set error conditions when nodes don't exist rather than retrying indefinitely.

When a node is removed, the controller would retry
indefinitely instead of setting an appropriate error condition.
Set error conditions when nodes don't exist rather than retrying
indefinitely.

Signed-off-by: Patryk Diak <[email protected]>
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2025
@kyrtapz kyrtapz changed the title Handle deleted nodes OCPBUGS-54805: Handle deleted nodes Oct 10, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. 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 Oct 10, 2025
@openshift-ci-robot
Copy link

@kyrtapz: This pull request references Jira Issue OCPBUGS-54805, which is invalid:

  • expected the bug to target the "4.21.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.

In response to this:

When a node is removed, the controller would retry indefinitely instead of setting an appropriate error condition. Set error conditions when nodes don't exist rather than retrying indefinitely.

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.

@kyrtapz
Copy link
Contributor Author

kyrtapz commented Nov 6, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Nov 6, 2025
@openshift-ci-robot
Copy link

@kyrtapz: This pull request references Jira Issue OCPBUGS-54805, 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 ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @huiran0826

In response to this:

/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 openshift-ci bot requested a review from huiran0826 November 6, 2025 16:45
@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

Walkthrough

Changes add defensive handling for missing nodes across cloud provider and controller logic. MovePrivateIP now accepts nil source nodes and skips port modifications accordingly. CloudPrivateIPConfig controller handles missing source/target nodes with appropriate status updates. Node controller gracefully handles deleted nodes.

Changes

Cohort / File(s) Summary
OpenStack provider
pkg/cloudprovider/openstack.go
MovePrivateIP modified to accept nil nodeToDel; logs and skips existing reservation modifications when source node is nil. When nodeToDel is provided, enumerates and unallows the IP from relevant ports. Refactored serverID variable scope for new nil-check branch.
CloudPrivateIPConfig controller logic
pkg/controller/cloudprivateipconfig/cloudprivateipconfig_controller.go
Added defensive handling for missing source/target nodes during move operations. Logs and continues if source node missing; updates CloudPrivateIPConfig status with error when target node missing. Improved Get error handling to distinguish NotFound cases and avoid requeue. Status updates include Assigned condition False with descriptive messages when nodes absent.
CloudPrivateIPConfig controller tests
pkg/controller/cloudprivateipconfig/cloudprivateipconfig_controller_test.go
Added test case for ADD operation with nonexistent target node, expecting Assigned condition False and error reason. Added test case for MOVE operation with nonexistent target node, expecting status error and prior node released from tracked state.
Node controller
pkg/controller/node/node_controller.go
Added apierrors import alias. Modified SetNodeEgressIPConfigAnnotation to detect IsNotFound error when fetching latest Node and return nil (no-op) instead of propagating error. Preserves existing error handling for other cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • MovePrivateIP nil nodeToDel logic: Verify that skipping port enumeration and reservation modifications when source node is nil does not leave inconsistent state or orphaned resources.
  • CloudPrivateIPConfig status update patterns: Multiple scenarios (missing source, missing target, failed move/add) require careful validation that status updates are consistent and reflect the correct conditions.
  • Test case coverage: Confirm that new test cases adequately validate the missing-node scenarios and expected status transitions, particularly the transition from assigned to error state during move failures.
  • Error handling consistency: Verify that the IsNotFound detection pattern and no-op approach is applied uniformly across different controllers and matches expected behavior.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between f852fe7 and e9a24a9.

📒 Files selected for processing (4)
  • pkg/cloudprovider/openstack.go (2 hunks)
  • pkg/controller/cloudprivateipconfig/cloudprivateipconfig_controller.go (3 hunks)
  • pkg/controller/cloudprivateipconfig/cloudprivateipconfig_controller_test.go (2 hunks)
  • pkg/controller/node/node_controller.go (2 hunks)

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@ricky-rav ricky-rav 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 Nov 6, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kyrtapz, ricky-rav

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

@kyrtapz
Copy link
Contributor Author

kyrtapz commented Nov 7, 2025

@huiran0826 mind helping with the /verified label? I know this is just a half of the solution but we need it anyway.

@huiran0826
Copy link

/verified later

@openshift-ci-robot
Copy link

@huiran0826: /verified later <@username> requires at least one GitHub @username to be specified (it can be a comma delimited list). It indicates the engineer(s) that will be performing the verification. See https://docs.ci.openshift.org/docs/architecture/jira/#premerge-verification for more information.

In response to this:

/verified later

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.

@huiran0826
Copy link

/verified later @huiran0826

@openshift-ci-robot openshift-ci-robot added verified-later verified Signifies that the PR passed pre-merge verification criteria labels Nov 7, 2025
@openshift-ci-robot
Copy link

@huiran0826: This PR has been marked to be verified later by @huiran0826.

In response to this:

/verified later @huiran0826

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.

@kyrtapz
Copy link
Contributor Author

kyrtapz commented Nov 7, 2025

/retest

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD da0442e and 2 for PR HEAD e9a24a9 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2025

@kyrtapz: The following tests 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/e2e-azure-serial-1of2 e9a24a9 link true /test e2e-azure-serial-1of2
ci/prow/e2e-azure-serial-2of2 e9a24a9 link true /test e2e-azure-serial-2of2
ci/prow/security e9a24a9 link false /test security

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.

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/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. 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 verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants