snapshot

package
v1.37.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Description: This file contains functions for provisioning from a snapshot. Note: This needs to be cleaned up.

Package snapshot stores shared code between devenv and the snapshot-uploader

Index

Constants

View Source
const (
	SnapshotNamespace = "velero"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Source is the configuration for downloading the snapshot
	Source *S3Config `json:"source"`

	// Dest is the configuration for extracting the snapshot
	Dest *S3Config `json:"dest"`
}

type Manager

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

Manager contains logic for handling snapshots in a developer environment.

func NewManager

func NewManager(log logrus.FieldLogger, b *box.Config) (*Manager, error)

NewManager creates a fully initialized Manager instance

func (*Manager) CreateBackupStorage

func (m *Manager) CreateBackupStorage(ctx context.Context, name, bucket string) error

CreateBackupStorage creates a backup storage location

func (*Manager) Restore

func (m *Manager) Restore(ctx context.Context, snapshotName string) error

Restore restores a given snapshot into an environment.

func (*Manager) RetrieveVeleroBackup

func (m *Manager) RetrieveVeleroBackup(ctx context.Context, snapshotName string) (*velerov1api.Backup, error)

RetrieveVeleroBackup returns a backup from a velero store.

type S3Config

type S3Config struct {
	// AWSAccessKey is the access key to use
	AWSAccessKey string `json:"aws_access_key"`

	// AWSSecretKey is the secret key to use
	AWSSecretKey string `json:"aws_secret_key"`

	// AWSSessionToken is the session token to use
	AWSSessionToken string `json:"aws_session_token,omitempty"`

	// S3Host is the host to use for connecting to S3
	S3Host string `json:"s3_host"`

	// Bucket is the bucket to use
	Bucket string `json:"s3_bucket"`

	// Region is the region of this bucket
	Region string `json:"region"`

	// Key is the key to use when accessing S3, either an object
	// or a path depending on the expected input.
	Key string `json:"s3_key"`

	// SnapshotTarget is the target snapshot to use if in source, if in dest
	// ignored.
	SnapshotTarget string `json:"snapshot_target,omitempty"`

	// SnapshotChannel is the target channel to use if in source, if in dest
	// ignored.
	SnapshotChannel box.SnapshotLockChannel `json:"snapshot_channel,omitempty"`

	// Digest is an optional digest to use when validating an object
	Digest string `json:"s3_md5_hash,omitempty"`
}

S3Config is configuration for accessing an object, or path in S3.

Jump to

Keyboard shortcuts

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