finalize

package
v0.66.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(ctx context.Context, rclient client.Client, instance client.Object) error

AddFinalizer adds finalizer to instance if needed.

func FreeIfNeeded

func FreeIfNeeded(ctx context.Context, rclient client.Client, object client.Object) error

FreeIfNeeded checks if resource must be freed from finalizer and garbage collected by kubernetes

func OnClusterDelete added in v0.66.0

func OnClusterDelete(ctx context.Context, rclient client.Client, cr build.ParentOpts) error

func OnClusterLoadBalancerDelete added in v0.66.0

func OnClusterLoadBalancerDelete(ctx context.Context, rclient client.Client, cr build.ParentOpts) error

OnClusterLoadBalancerDelete removes vmauth loadbalancer components for cluster

func OnInsertDelete added in v0.66.0

func OnInsertDelete(ctx context.Context, rclient client.Client, cr build.ParentOpts) error

OnInsertDelete removes all objects related to insert component

func OnSelectDelete added in v0.66.0

func OnSelectDelete(ctx context.Context, rclient client.Client, cr build.ParentOpts) error

OnSelectDelete removes all objects related to select component

func OnStorageDelete added in v0.66.0

func OnStorageDelete(ctx context.Context, rclient client.Client, cr build.ParentOpts) error

OnStorageDelete removes all objects related to storage component

func OnVLAgentDelete added in v0.61.0

func OnVLAgentDelete(ctx context.Context, rclient client.Client, cr *vmv1.VLAgent) error

OnVLAgentDelete deletes all vlagent related resources

func OnVLSingleDelete added in v0.59.0

func OnVLSingleDelete(ctx context.Context, rclient client.Client, cr *vmv1.VLSingle) error

OnVLSingleDelete deletes all vlogs related resources

func OnVLogsDelete added in v0.47.0

func OnVLogsDelete(ctx context.Context, rclient client.Client, cr *vmv1beta1.VLogs) error

OnVLogsDelete deletes all vlogs related resources

func OnVMAgentDelete

func OnVMAgentDelete(ctx context.Context, rclient client.Client, cr *vmv1beta1.VMAgent) error

OnVMAgentDelete deletes all vmagent related resources

func OnVMAlertDelete

func OnVMAlertDelete(ctx context.Context, rclient client.Client, cr *vmv1beta1.VMAlert) error

OnVMAlertDelete deletes all vmalert related resources

func OnVMAlertManagerDelete

func OnVMAlertManagerDelete(ctx context.Context, rclient client.Client, cr *vmv1beta1.VMAlertmanager) error

OnVMAlertManagerDelete deletes all alertmanager related resources

func OnVMAnomalyDelete added in v0.60.0

func OnVMAnomalyDelete(ctx context.Context, rclient client.Client, cr *vmv1.VMAnomaly) error

OnVMAnomalyDelete deletes all anomaly related resources

func OnVMAuthDelete

func OnVMAuthDelete(ctx context.Context, rclient client.Client, cr *vmv1beta1.VMAuth) error

OnVMAuthDelete deletes all vmauth related resources

func OnVMSingleDelete

func OnVMSingleDelete(ctx context.Context, rclient client.Client, cr *vmv1beta1.VMSingle) error

OnVMSingleDelete deletes all vmsingle related resources

func OnVMUserDelete

func OnVMUserDelete(ctx context.Context, rclient client.Client, cr *vmv1beta1.VMUser) error

OnVMUserDelete deletes all vmuser related resources

func OnVTSingleDelete added in v0.63.0

func OnVTSingleDelete(ctx context.Context, rclient client.Client, cr *vmv1.VTSingle) error

OnVTSingleDelete deletes all vtsingle related resources

func RemoveFinalizer

func RemoveFinalizer(ctx context.Context, rclient client.Client, instance client.Object) error

RemoveFinalizer removes finalizer from instance if needed.

func RemoveOrphanedDeployments

func RemoveOrphanedDeployments(ctx context.Context, rclient client.Client, cr orphanedCRD, keepNames map[string]struct{}) error

RemoveOrphanedDeployments removes Deployments detached from given object

func RemoveOrphanedHPAs added in v0.66.0

func RemoveOrphanedHPAs(ctx context.Context, rclient client.Client, cr orphanedCRD, keepNames map[string]struct{}) error

RemoveOrphanedHPAs removes HPAs detached from given object

func RemoveOrphanedPDBs added in v0.66.0

func RemoveOrphanedPDBs(ctx context.Context, rclient client.Client, cr orphanedCRD, keepNames map[string]struct{}) error

RemoveOrphanedPDBs removes PDBs detached from given object

func RemoveOrphanedSTSs

func RemoveOrphanedSTSs(ctx context.Context, rclient client.Client, cr orphanedCRD, keepNames map[string]struct{}) error

RemoveOrphanedSTSs removes StatefulSets detached from given object

func RemoveOrphanedServices

func RemoveOrphanedServices(ctx context.Context, rclient client.Client, cr orphanedCRD, keepNames map[string]struct{}) error

RemoveOrphanedServices removes Services detached from given object

func RemoveOrphanedVMServiceScrapes added in v0.66.0

func RemoveOrphanedVMServiceScrapes(ctx context.Context, rclient client.Client, cr orphanedCRD, keepNames map[string]struct{}) error

RemoveOrphanedVMServiceScrapes removes VMSeviceScrapes detached from given object

func SafeDelete

func SafeDelete(ctx context.Context, rclient client.Client, r client.Object) error

SafeDelete removes object, ignores notfound error.

func SafeDeleteForSelectorsWithFinalizer added in v0.57.0

func SafeDeleteForSelectorsWithFinalizer(ctx context.Context, rclient client.Client, r client.Object, selectors map[string]string, owner *metav1.OwnerReference) error

SafeDeleteForSelectorsWithFinalizer removes given object if it matches provided label selectors

func SafeDeleteWithFinalizer added in v0.48.0

func SafeDeleteWithFinalizer(ctx context.Context, rclient client.Client, r client.Object, owner *metav1.OwnerReference) error

SafeDeleteWithFinalizer removes object, ignores notfound error.

Types

type ChildCleaner added in v0.66.0

type ChildCleaner struct {
	// contains filtered or unexported fields
}

ChildCleaner cleans dependent resources for cluster CRs excluding ones which are listed in cleaner maps

func NewChildCleaner added in v0.66.0

func NewChildCleaner() *ChildCleaner

NewChildCleaner initializes ChildCleaner

func (*ChildCleaner) KeepHPA added in v0.66.0

func (cc *ChildCleaner) KeepHPA(v string)

KeepHPA adds given HorizontalPodAutoscaler's name to a map of resource names to be excluded from deletion

func (*ChildCleaner) KeepPDB added in v0.66.0

func (cc *ChildCleaner) KeepPDB(v string)

KeepPDB adds given PodDisruptionBudget's name to a map of resource names to be excluded from deletion

func (*ChildCleaner) KeepScrape added in v0.66.0

func (cc *ChildCleaner) KeepScrape(v string)

KeepScrape adds given VMServiceScrape's name to a map of resource names to be excluded from deletion

func (*ChildCleaner) KeepService added in v0.66.0

func (cc *ChildCleaner) KeepService(v string)

KeepService adds given HorizontalPodAutoscaler's name to a map of resource names to be excluded from deletion

func (*ChildCleaner) RemoveOrphaned added in v0.66.0

func (cc *ChildCleaner) RemoveOrphaned(ctx context.Context, rclient client.Client, cr build.ParentOpts) error

RemoveOrphaned removes cr dependent resources excluding ones, which are defined in cleaner's maps

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL