snapshot

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileSystemMinioConfigMapName, FileSystemMinioSecretName                   = "kotsadm-fs-minio", "kotsadm-fs-minio-creds"
	FileSystemMinioDeploymentName, FileSystemMinioServiceName                 = "kotsadm-fs-minio", "kotsadm-fs-minio"
	FileSystemMinioProvider, FileSystemMinioBucketName, FileSystemMinioRegion = "aws", "velero", "minio"
	FileSystemMinioServicePort                                                = 9000
)
View Source
const (
	VeleroNamespaceConfigMapName = "kotsadm-velero-namespace"
)

Variables

This section is empty.

Functions

func BuildAWSCredentials

func BuildAWSCredentials(accessKeyID, secretAccessKey string) ([]byte, error)

func BuildStoreFileSystem added in v1.33.0

func BuildStoreFileSystem(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) (*types.StoreFileSystem, error)

func CheckKotsadmVeleroAccess

func CheckKotsadmVeleroAccess(ctx context.Context, kotsadmNamespace string) (requiresAccess bool, finalErr error)

func ConfigureStore

func ConfigureStore(ctx context.Context, options ConfigureStoreOptions) (*types.Store, error)

func CreateFileSystemMinioBucket

func CreateFileSystemMinioBucket(ctx context.Context, clientset kubernetes.Interface, namespace string, registryOptions kotsadmtypes.KotsadmOptions) error

func CreateInstanceBackup

func CreateInstanceBackup(ctx context.Context, options CreateInstanceBackupOptions) error

func DeployFileSystemMinio

func DeployFileSystemMinio(ctx context.Context, clientset kubernetes.Interface, deployOptions FileSystemDeployOptions, registryOptions kotsadmtypes.KotsadmOptions) error

func DetectVeleroNamespace

func DetectVeleroNamespace(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) (string, error)

DetectVeleroNamespace will detect and validate the velero namespace kotsadmNamespace is only required in minimal rbac installations. if empty, cluster scope privilages will be needed to detect and validate velero

func EnsureVeleroNamespaceConfigMap

func EnsureVeleroNamespaceConfigMap(ctx context.Context, clientset kubernetes.Interface, veleroNamespace string, kotsadmNamespace string) error

func EnsureVeleroPermissions

func EnsureVeleroPermissions(ctx context.Context, clientset kubernetes.Interface, veleroNamespace string, kotsadmNamespace string) error

func FindBackupStoreLocation

func FindBackupStoreLocation(ctx context.Context, kotsadmNamespace string) (*velerov1.BackupStorageLocation, error)

FindBackupStoreLocation will find the backup storage location used by velero kotsadmNamespace is only required in minimal rbac installations. if empty, cluster scope privilages will be needed to detect and validate velero

func GetCurrentFileSystemConfig

func GetCurrentFileSystemConfig(ctx context.Context, namespace string) (*types.FileSystemConfig, error)

func GetGlobalStore

func GetGlobalStore(ctx context.Context, kotsadmNamepsace string, kotsadmVeleroBackendStorageLocation *velerov1.BackupStorageLocation) (*types.Store, error)

GetGlobalStore will return the global store from kotsadmVeleroBackupStorageLocation or will find it, if the param is nil

func ListInstanceBackups

func ListInstanceBackups(ctx context.Context, options ListInstanceBackupsOptions) ([]velerov1.Backup, error)

func ListInstanceRestores

func ListInstanceRestores(ctx context.Context, options ListInstanceRestoresOptions) ([]velerov1.Restore, error)

func Redact

func Redact(store *types.Store) error

func RestoreInstanceBackup

func RestoreInstanceBackup(ctx context.Context, options RestoreInstanceBackupOptions) (*velerov1.Restore, error)

func TryGetVeleroNamespaceFromConfigMap

func TryGetVeleroNamespaceFromConfigMap(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) string

TryGetVeleroNamespaceFromConfigMap in the case of minimal rbac installations, a configmap containing the velero namespace will be created once the user gives kotsadm access to velero using the cli

Types

type ConfigureStoreOptions

type ConfigureStoreOptions struct {
	Provider string
	Bucket   string
	Path     string

	AWS        *types.StoreAWS
	Google     *types.StoreGoogle
	Azure      *types.StoreAzure
	Other      *types.StoreOther
	Internal   bool
	FileSystem bool

	KotsadmNamespace string
	RegistryOptions  *kotsadmtypes.KotsadmOptions

	// If set to true, will validate the endpoint and the bucket using a pod instead (when applicable).
	// Will be ignored if SkipValidation is set to true.
	ValidateUsingAPod bool
	SkipValidation    bool
}

type CreateInstanceBackupOptions

type CreateInstanceBackupOptions struct {
	Namespace string
	Wait      bool
}

type FileSystemDeployOptions

type FileSystemDeployOptions struct {
	Namespace        string
	IsOpenShift      bool
	ForceReset       bool
	FileSystemConfig types.FileSystemConfig
}

type InvalidStoreDataError

type InvalidStoreDataError struct {
	Message string
}

func (*InvalidStoreDataError) Error

func (e *InvalidStoreDataError) Error() string

type ListInstanceBackupsOptions

type ListInstanceBackupsOptions struct {
	Namespace string
}

type ListInstanceRestoresOptions

type ListInstanceRestoresOptions struct {
	Namespace string
}

type ResetFileSystemError

type ResetFileSystemError struct {
	Message string
}

func (ResetFileSystemError) Error

func (e ResetFileSystemError) Error() string

type RestoreInstanceBackupOptions

type RestoreInstanceBackupOptions struct {
	BackupName      string
	WaitForApps     bool
	VeleroNamespace string
}

type ValidateStoreOptions

type ValidateStoreOptions struct {
	KotsadmNamespace string
	RegistryOptions  *kotsadmtypes.KotsadmOptions
	// If set to true, will validate the endpoint and the bucket using a pod instead (when applicable)
	ValidateUsingAPod bool
}

type VeleroRBACResponse

type VeleroRBACResponse struct {
	Success                     bool   `json:"success"`
	Error                       string `json:"error,omitempty"`
	KotsadmNamespace            string `json:"kotsadmNamespace,omitempty"`
	KotsadmRequiresVeleroAccess bool   `json:"kotsadmRequiresVeleroAccess,omitempty"`
}

type VeleroStatus

type VeleroStatus struct {
	Version   string
	Plugins   []string
	Status    string
	Namespace string

	ResticVersion string
	ResticStatus  string
}

func DetectVelero

func DetectVelero(ctx context.Context, kotsadmNamespace string) (*VeleroStatus, error)

func (*VeleroStatus) ContainsPlugin

func (s *VeleroStatus) ContainsPlugin(plugin string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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