Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

OSAC-779, OSAC-780: fix PublicIP feedback controller and detach annotation - #236

Merged
openshift-merge-bot[bot] merged 2 commits into
osac-project:mainfrom
akshaynadkarni:fix/osac-779-feedback-controller-deleting-state
May 9, 2026
Merged

openshift-merge-bot[bot] merged 2 commits into
osac-project:mainfrom
akshaynadkarni:fix/osac-779-feedback-controller-deleting-state

Conversation

@akshaynadkarni

@akshaynadkarni akshaynadkarni commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes for the PublicIP delete and detach flows:

  1. OSAC-779: Feedback controller uses DELETING (not RELEASING) when a PublicIP CR
    is being deleted. Bumps private-api BSR module to v0.0.61.

  2. OSAC-780: Target-namespace annotation is only cleared when state is ALLOCATED
    (detach completed), not when state is ATTACHED (about to detach). The previous check
    (state != Releasing) failed because the annotation sync runs before the state
    transitions to RELEASING in the same reconcile loop.

Why

OSAC-779: The feedback controller set RELEASING for all deletions, but RELEASING is the
detach flow (ATTACHED -> RELEASING -> ALLOCATED). The fulfillment-service state machine
rejected ALLOCATED -> RELEASING, leaving the CR stuck in Deleting phase.

OSAC-780: The syncComputeInstanceTargetNamespaceAnnotation() function runs before the
state transition in handleUpdate(). When spec.computeInstance is cleared (detach trigger),
the annotation was deleted while state was still ATTACHED (not yet RELEASING), so the
OSAC-776 preservation check never triggered. The AAP detach job then failed because the
annotation was missing.

Testing

go build ./...                                                           # pass
ginkgo run --focus="PublicIP" internal/controller                        # 89 passed, 0 failed

E2E verified on edge22: full lifecycle (create pool, create IP, attach, detach, delete)
completed successfully with both fixes applied.

Related PRs

  • fulfillment-service PR #515 (merged): added PUBLIC_IP_STATE_DELETING to proto enum
  • osac-aap PR (pending): relaxed detach playbook validation for spec.computeInstance

Tickets


Signed-off-by: akshaynadkarni 25892229+akshaynadkarni@users.noreply.github.com
Assisted-by: Cursor/Claude

The feedback controller's handleDelete() was setting RELEASING when a
PublicIP CR was being deleted. RELEASING is for the detach flow
(ATTACHED -> RELEASING -> ALLOCATED), not for resource deletion. The
fulfillment-service state machine rejected ALLOCATED -> RELEASING,
leaving the CR stuck in Deleting phase.

Now handleDelete() sets DELETING, matching the pattern used by the
Subnet feedback controller. The detach flow through syncState()
continues to use RELEASING unchanged.

Bumps private-api BSR module from v0.0.60 to v0.0.61 which adds the
PUBLIC_IP_STATE_DELETING enum value.

Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
Assisted-by: Cursor/Claude
Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Bumps private-api proto input to v0.0.61, changes feedback delete mapping to set public IP status to PUBLIC_IP_STATE_DELETING for non-Failed deletions, narrows when the publicip-target-namespace annotation is cleared (only when status == Allocated), and updates tests accordingly.

Changes

Public IP Deletion & Annotation Changes

Layer / File(s) Summary
API Contract Update
buf.gen.yaml
Private-api proto input bumped from v0.0.60 to v0.0.61 (buf.build/osac-project/private-api).
Deletion State Mapping
internal/controller/publicip_feedback_controller.go
handleDelete now sets PUBLIC_IP_STATE_DELETING instead of PUBLIC_IP_STATE_RELEASING for non-Failed deletion paths.
Annotation Clear Condition
internal/controller/publicip_controller.go
publicip-target-namespace annotation is cleared when spec.computeInstance is emptied only if PublicIP status == Allocated; preserved in Releasing/Attached detach phases.
Tests / Assertions
internal/controller/publicip_feedback_controller_test.go, internal/controller/publicip_controller_test.go
Feedback deletion tests updated to expect PUBLIC_IP_STATE_DELETING; controller tests updated to require status==Allocated to clear the annotation and to assert preservation during Releasing/Attached detach cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

lgtm, jira/valid-reference

Suggested reviewers

  • eranco74
  • adriengentil

Poem

🐰 I hopped through code with nimble paws,
From RELEASING to DELETING — new applause!
Tests aligned and proto bumped too,
Annotations stay when states aren't through.
A tiny hop, a stable cause.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately reflects the main changes: fixing the PublicIP feedback controller to use the DELETING state (OSAC-779) and fixing the detach annotation handling (OSAC-780).
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@akshaynadkarni

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@akshaynadkarni
akshaynadkarni marked this pull request as ready for review May 8, 2026 22:19
The annotation sync in syncComputeInstanceTargetNamespaceAnnotation()
runs before the state transition from ATTACHED to RELEASING in
handleUpdate(). The OSAC-776 preservation check tested for state ==
RELEASING, but the state was still ATTACHED at that point, so the
annotation was always deleted before the AAP detach job could use it.

Changed the condition from "preserve only during RELEASING" to "only
clean up when ALLOCATED" (detach fully completed). This ensures the
annotation survives the entire detach flow regardless of reconciliation
ordering.

Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
Assisted-by: Cursor/Claude
Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
@openshift-ci-robot

openshift-ci-robot commented May 9, 2026

Copy link
Copy Markdown

@akshaynadkarni: This pull request references OSAC-779 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

OSAC-779: Updates the PublicIP feedback controller to report DELETING (not RELEASING)
when a PublicIP CR is being deleted. Bumps private-api BSR module to v0.0.61.

Why

The feedback controller's handleDelete() was setting RELEASING for all deletions,
but RELEASING is the detach flow (ATTACHED -> RELEASING -> ALLOCATED). When deleting
an ALLOCATED PublicIP, the fulfillment-service rejected ALLOCATED -> RELEASING as an
invalid state transition, leaving the K8s CR stuck in Deleting phase.

DELETING is now a distinct state in the proto (added in fulfillment-service PR #515),
and this PR uses it in the operator.

Testing

go build ./...                                                           # pass
ginkgo run --focus="PublicIP" internal/controller                        # 88 passed, 0 failed
ginkgo run --focus="feedback.*PublicIP" internal/controller              # 4 passed, 0 failed

Tests updated:

  • Two deletion tests now expect DELETING instead of RELEASING
  • Detach test (syncState with Releasing) still expects RELEASING (unchanged)

Related PRs

  • fulfillment-service PR #515 (merged): added PUBLIC_IP_STATE_DELETING to proto enum and state map

Ticket

OSAC-779


Signed-off-by: akshaynadkarni 25892229+akshaynadkarni@users.noreply.github.com
Assisted-by: Cursor/Claude

Summary by CodeRabbit

  • Chores

  • Updated managed API module version.

  • Bug Fixes

  • Adjusted public IP deletion state transition to use a distinct "deleting" state in relevant flows.

  • Preserve the public IP target-namespace annotation in additional status phases; only remove it when the IP is Allocated.

  • Tests

  • Updated tests to match the revised deletion state and annotation preservation behavior.

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.

@akshaynadkarni akshaynadkarni changed the title OSAC-779: use DELETING state in PublicIP feedback controller OSAC-779, OSAC-780: fix PublicIP feedback controller and detach annotation May 9, 2026
@openshift-ci-robot

openshift-ci-robot commented May 9, 2026

Copy link
Copy Markdown

@akshaynadkarni: This pull request references OSAC-779 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

This pull request references OSAC-780 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Two fixes for the PublicIP delete and detach flows:

  1. OSAC-779: Feedback controller uses DELETING (not RELEASING) when a PublicIP CR
    is being deleted. Bumps private-api BSR module to v0.0.61.

  2. OSAC-780: Target-namespace annotation is only cleared when state is ALLOCATED
    (detach completed), not when state is ATTACHED (about to detach). The previous check
    (state != Releasing) failed because the annotation sync runs before the state
    transitions to RELEASING in the same reconcile loop.

Why

OSAC-779: The feedback controller set RELEASING for all deletions, but RELEASING is the
detach flow (ATTACHED -> RELEASING -> ALLOCATED). The fulfillment-service state machine
rejected ALLOCATED -> RELEASING, leaving the CR stuck in Deleting phase.

OSAC-780: The syncComputeInstanceTargetNamespaceAnnotation() function runs before the
state transition in handleUpdate(). When spec.computeInstance is cleared (detach trigger),
the annotation was deleted while state was still ATTACHED (not yet RELEASING), so the
OSAC-776 preservation check never triggered. The AAP detach job then failed because the
annotation was missing.

Testing

go build ./...                                                           # pass
ginkgo run --focus="PublicIP" internal/controller                        # 89 passed, 0 failed

E2E verified on edge22: full lifecycle (create pool, create IP, attach, detach, delete)
completed successfully with both fixes applied.

Related PRs

  • fulfillment-service PR #515 (merged): added PUBLIC_IP_STATE_DELETING to proto enum
  • osac-aap PR (pending): relaxed detach playbook validation for spec.computeInstance

Tickets


Signed-off-by: akshaynadkarni 25892229+akshaynadkarni@users.noreply.github.com
Assisted-by: Cursor/Claude

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.

@akshaynadkarni

Copy link
Copy Markdown
Contributor Author

/retest-required

@openshift-ci

openshift-ci Bot commented May 9, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akshaynadkarni, DakCrowder, SiddarthR56

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

@akshaynadkarni

Copy link
Copy Markdown
Contributor Author

/override ci/prow/e2e-metal-vmaas-compute-instance-api-fields

@openshift-ci

openshift-ci Bot commented May 9, 2026

Copy link
Copy Markdown

@akshaynadkarni: Overrode contexts on behalf of akshaynadkarni: ci/prow/e2e-metal-vmaas-compute-instance-api-fields

Details

In response to this:

/override ci/prow/e2e-metal-vmaas-compute-instance-api-fields

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 c245efd into osac-project:main May 9, 2026
16 checks passed
@openshift-ci

openshift-ci Bot commented May 9, 2026

Copy link
Copy Markdown

@akshaynadkarni: 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/e2e-metal-vmaas-compute-instance-api-fields 2cb9ac6 link unknown /test e2e-metal-vmaas-compute-instance-api-fields

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants