state

package
v0.121.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupState

func CleanupState(ctx context.Context, log logging.Logger, kubeClient client.Client, namespace string, deployItem lsv1alpha1.ObjectReference) error

CleanupState deletes all state secrets for a deployitem

func StateSecretListOptions

func StateSecretListOptions(namespace string, deployItem lsv1alpha1.ObjectReference) []client.ListOption

StateSecretListOptions returns the list options for all state secrets of a deploy item

Types

type State

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

State handles the backup and restore of state of container deploy item.

func New

func New(kubeClient client.Client, namespace string, deployItemKey lsv1alpha1.ObjectReference, statePath string) *State

New creates a new state instance.

func (*State) Backup

func (s *State) Backup(ctx context.Context) error

Backup tars the content of the State directory and stores it in a secrets in the cluster.

func (*State) Restore

func (s *State) Restore(ctx context.Context) error

Restore restores the latest state from the k8s cluster to the configured state path.

func (*State) WithFs

func (s *State) WithFs(fs vfs.FileSystem) *State

WithFs sets the fs for the state

Jump to

Keyboard shortcuts

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