preservation

package
v0.0.0-...-5b503c2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InternalPreservationLabelKey is used to mark resources that are required internally
	// for ClusterInstance operations and should not be deleted during preservation or restoration.
	InternalPreservationLabelKey = v1alpha1.PreservationLabelKey + ".internal"

	// InternalPreservationLabelValue represents the label value used for identifying
	// internally required ClusterInstance resources.
	InternalPreservationLabelValue = "cluster-instance-required-resource"

	// PreservationModeInternal is a special preservation mode (for internal use only)
	// that indicates resources essential for ClusterInstance operations will be preserved.
	PreservationModeInternal v1alpha1.PreservationMode = "Internal"
)
View Source
const (

	// ClusterIdentityDataAnnotationKey stores cluster identity data for preserved resources.
	ClusterIdentityDataAnnotationKey = preservedDataLabelKey + ".cluster-identity"

	// RestoredAtAnnotationKey indicates when a resource was restored.
	RestoredAtAnnotationKey = v1alpha1.PreservationLabelKey + ".restored-at"
)

Variables

This section is empty.

Functions

func Backup

func Backup(
	ctx context.Context,
	c client.Client,
	log *zap.Logger,
	clusterInstance *v1alpha1.ClusterInstance,
) (err error)

Backup preserves ConfigMaps and Secrets based on the specified preservation mode. The outcome of each backup is logged and any errors encountered are aggregated.

func Cleanup

func Cleanup(
	ctx context.Context,
	c client.Client,
	deletionHandler *deletion.DeletionHandler,
	log *zap.Logger,
	clusterInstance *v1alpha1.ClusterInstance,
) (completedCleanup bool, err error)

Cleanup deletes preserved ConfigMaps and Secrets. The outcome of each deletion is logged and any errors encountered are aggregated.

func GetPreservedResourceCounts

func GetPreservedResourceCounts(
	ctx context.Context,
	c client.Client,
	log *zap.Logger,
	clusterInstance *v1alpha1.ClusterInstance,
) (clusterIDCount, otherCount int, err error)

func GetRestoredResourceCounts

func GetRestoredResourceCounts(
	ctx context.Context,
	c client.Client,
	log *zap.Logger,
	clusterInstance *v1alpha1.ClusterInstance,
) (clusterIDCount, otherCount int, err error)

func Restore

func Restore(
	ctx context.Context,
	c client.Client,
	log *zap.Logger,
	clusterInstance *v1alpha1.ClusterInstance,
) (err error)

Restore restores ConfigMaps and Secrets from preserved data. The outcome of each restore is logged and any errors encountered are aggregated.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳