Repository navigation
feat: Support delaying SveltosCluster removal for cleanup - #384
Merged
gianlucam76 merged 1 commit intoSep 17, 2026
Merged
Conversation
SveltosCluster deletion can now be delayed via spec.cleanupGracePeriod. When a SveltosCluster is deleted and this field is set, the cluster stays registered, present, with a deletion timestamp, but not yet gone, for that long before it's actually removed. This closes a gap for clusters that have nothing else holding them open during teardown. A ClusterAPI Cluster stays visible for a while after deletion because its infrastructure provider's own finalizer blocks removal until the underlying VPC/instances/load balancers are actually torn down. That window is what makes it possible to run last-minute cleanup against it. A bare SveltosCluster (used for non-ClusterAPI clusters) has no such finalizer and disappears the instant it's deleted, so nothing gets a chance to react. With cleanupGracePeriod set, that same kind of window now exists for any SveltosCluster: cleanup automation. For example an EventSource/EventTrigger watching this SveltosCluster with includeDeletingResources: true has a guaranteed amount of time to run before the object actually disappears. If cleanupGracePeriod is not set, deletion behaves exactly as it does today, immediate. Usage ```yaml apiVersion: lib.projectsveltos.io/v1beta1 kind: SveltosCluster metadata: name: my-cluster spec: cleanupGracePeriod: 10m ```
gianlucam76
force-pushed
the
sveltoscluster-delete-timer
branch
from
September 17, 2026 07:29
a7718db to
d69faf5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SveltosCluster deletion can now be delayed via spec.cleanupGracePeriod. When a SveltosCluster is deleted and this field is set, the cluster stays registered, present, with a deletion timestamp, but not yet gone, for that long before it's actually removed.
This closes a gap for clusters that have nothing else holding them open during teardown. A ClusterAPI Cluster stays visible for a while after deletion because its infrastructure provider's own finalizer blocks removal until the underlying VPC/instances/load balancers are actually torn down. That window is what makes it possible to run last-minute cleanup against it. A bare SveltosCluster (used for non-ClusterAPI clusters) has no such finalizer and disappears the instant it's deleted, so nothing gets a chance to react.
With cleanupGracePeriod set, that same kind of window now exists for any SveltosCluster: cleanup automation. For example an EventSource/EventTrigger watching this SveltosCluster with includeDeletingResources: true has a guaranteed amount of time to run before the object actually disappears.
If cleanupGracePeriod is not set, deletion behaves exactly as it does today, immediate.
Usage