Skip to content

fix(openstack-sync-operator): clear orphaned profiles when prune is off and few improvements - #2321

Draft
haseebsyed12 wants to merge 2 commits into
mainfrom
openstack-sync-2237-followups
Draft

fix(openstack-sync-operator): clear orphaned profiles when prune is off and few improvements#2321
haseebsyed12 wants to merge 2 commits into
mainfrom
openstack-sync-2237-followups

Conversation

@haseebsyed12

Copy link
Copy Markdown
Contributor

What does this change do?

Upgrade impact

  • This change requires operator action to upgrade. If checked, add the
    upgrade-impact label and a release note: run scriv create from the
    repository root and describe the required action in the generated
    changelog.d/ file. See RELEASING.md.

Operator action means anything a deployment has to do beyond a normal resync:
deploy repo or values changes, new or removed secrets, enabling or disabling a
component, or a manual one-time step.

@haseebsyed12
haseebsyed12 requested a review from a team September 9, 2026 12:27

@cardoe cardoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is still a lifecycle gap when PRUNE is false.

The orphan sweep is called from RouterFlavorPlugin.prune(), but the framework does not obtain a connection for a deletion-only run when plugin.config.prune is false. If a reconcile creates a service profile and then fails before binding it, deleting the final CR gives us one last binding context containing the credentials. However, there are no resources to reconcile, so no connection is cached, and _run_prune skips the group before RouterFlavorPlugin.prune() can call prune_orphaned_profiles(). With no CRs left, later scheduled runs also have no credentials and the orphan remains indefinitely.

I think the framework or plugin contract needs to distinguish flavor pruning from safe orphan collection so this plugin can request a connection even when PRUNE is false. Please add an integration test through run_sync() with a deletion-only input, PRUNE=false, and an orphaned managed profile; calling RouterFlavorPlugin.prune() directly does not exercise the connection gate that causes the problem.

@haseebsyed12
haseebsyed12 force-pushed the openstack-sync-2237-followups branch 2 times, most recently from 63893d2 to 9d5b3a1 Compare September 10, 2026 12:00
@haseebsyed12
haseebsyed12 requested a review from cardoe September 10, 2026 12:21
@haseebsyed12
haseebsyed12 force-pushed the openstack-sync-2237-followups branch from 9d5b3a1 to f1f24de Compare September 10, 2026 15:26
@haseebsyed12
haseebsyed12 force-pushed the openstack-sync-2237-followups branch from f1f24de to 0fea12e Compare September 10, 2026 15:29
@haseebsyed12 haseebsyed12 changed the title fix: clear orphaned profiles when prune is off and few improvements fix(openstack-sync-operator): clear orphaned profiles when prune is off and few improvements Sep 10, 2026
…status write

Shell-operator hands a hook every event it has queued and replays the whole
backlog while a run keeps failing, so a batch can carry dozens of events for
one CR. Key the changed and deleted maps by CR uid so one CR is one reconcile,
and drop a CR whose Deleted event is in the same batch: the prune still
removes it.

A status write for a CR that is already gone now logs at info and returns,
rather than reporting a failure nothing is waiting on.
@haseebsyed12
haseebsyed12 marked this pull request as draft September 10, 2026 19:37
@haseebsyed12
haseebsyed12 removed the request for review from cardoe September 10, 2026 19:37
@haseebsyed12
haseebsyed12 force-pushed the openstack-sync-2237-followups branch from 2165ef2 to 77dfd80 Compare September 11, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants