Skip to content

fix: clean up of resources from deleted clusters.#504

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:cleanup
Jul 15, 2026
Merged

fix: clean up of resources from deleted clusters.#504
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:cleanup

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

Clean up ClusterProfile/ConfigMap/Secret and EventReport left behind by deleted clusters

If a Cluster/SveltosCluster is deleted (or event-manager is down when it happens), the EventReport, ClusterProfile, ConfigMap, and Secret instances that were created because of it could be left behind indefinitely. The existing cleanup paths were triggered off Cluster delete watches or off EventTrigger reconciles. The cluster ones can be missed the transition entirely if event-manager wasn't running at the time.

This PR fixes that. A new pollStaleEventReports background loop (5-minute tick, only on the default/non-sharded instance, independent of EventReportMode): lists every Cluster/SveltosCluster cluster-wide and every EventReport, and for any EventReport whose cluster no longer exists, removes every EventTrigger's instantiated ClusterProfile/ConfigMap/Secret for that cluster plus the stale EventReport itself.

Clean up ClusterProfile/ConfigMap/Secret and EventReport left
behind by deleted clusters

If a Cluster/SveltosCluster is deleted (or event-manager is down when
it happens), the EventReport, ClusterProfile, ConfigMap, and Secret
instances that were created because of it could be left behind indefinitely.
The existing cleanup paths were triggered off Cluster delete watches or off
EventTrigger reconciles. The cluster ones can be missed the transition entirely
if event-manager wasn't running at the time.

This PR fixes that. A new `pollStaleEventReports` background loop (5-minute tick,
only on the default/non-sharded instance, independent of EventReportMode): lists
every Cluster/SveltosCluster cluster-wide and every EventReport, and for any
EventReport whose cluster no longer exists, removes every EventTrigger's instantiated
ClusterProfile/ConfigMap/Secret for that cluster plus the stale EventReport itself.
@gianlucam76
gianlucam76 merged commit 196da6c into projectsveltos:main Jul 15, 2026
15 of 16 checks passed
@gianlucam76
gianlucam76 deleted the cleanup branch July 15, 2026 18:39
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.

1 participant