fix(openstack-sync-operator): clear orphaned profiles when prune is off and few improvements - #2321
fix(openstack-sync-operator): clear orphaned profiles when prune is off and few improvements#2321haseebsyed12 wants to merge 2 commits into
Conversation
cardoe
left a comment
There was a problem hiding this comment.
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.
63893d2 to
9d5b3a1
Compare
9d5b3a1 to
f1f24de
Compare
f1f24de to
0fea12e
Compare
…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.
2165ef2 to
77dfd80
Compare
What does this change do?
Upgrade impact
upgrade-impactlabel and a release note: runscriv createfrom therepository 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.