backup

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Copyright 2022 The SODA Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	EventValidationSuccess     = "ValidationSuccessful"
	EventPreHookFailed         = "PreHookFailed"
	EventPostHookFailed        = "PostHookFailed"
	EventVolumeBackupSuccess   = "VolumeBackupSuccess"
	EventVolumeBackupFailed    = "VolumeBackupFailed"
	EventVolumeBackupScheduled = "VolumeBackupScheduled"
	EventResourceBackupSuccess = "ResourceBackupSuccess"
	EventResourceBackupFailed  = "ResourceBackupFailed"
)
View Source
const (
	PVCKind   = "PersistentVolumeClaim"
	PVKind    = "PersistentVolume"
	NodeKind  = "Node"
	EventKind = "Event"
)
View Source
const (
	AnnResourceSelector = "kahu.io/backup-resources"
)

Variables

This section is empty.

Functions

func CoreGroupResourcePriority added in v0.1.1

func CoreGroupResourcePriority(resource string) int

func NewController

func NewController(
	ctx context.Context,
	config *Config,
	kubeClient kubernetes.Interface,
	kahuClient versioned.Interface,
	dynamicClient dynamic.Interface,
	informer kahuinformer.SharedInformerFactory,
	eventBroadcaster record.EventBroadcaster,
	discoveryHelper discovery.DiscoveryHelper,
	hookExecutor hooks.Hooks,
	volumeHandler volume.Interface) (controllers.Controller, error)

Types

type Config added in v0.1.1

type Config struct {
	SupportedResources string
}

type DependencyProvider added in v0.1.1

type DependencyProvider interface {
	GetDependency(kubeClient kubernetes.Interface,
		resource *unstructured.Unstructured) ([]ResourceIdentifier, error)
}

type GroupResouceVersion added in v0.1.1

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

type Interface added in v0.1.1

type Interface interface {
	Resolve(cache.Indexer) error
}

func NewResolver added in v0.1.1

func NewResolver(logger log.FieldLogger,
	kubeClient kubernetes.Interface,
	dynamicClient dynamic.Interface,
	discoveryHelper discovery.DiscoveryHelper) Interface

type KubernetesResource added in v0.1.1

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

type Phase added in v0.1.1

type Phase int

type PrepareBackup added in v0.1.1

type PrepareBackup struct {
	*kahuapi.Backup

	StorageLocation *kahuapi.BackupLocation
	BackedUpItems   map[itemKey]struct{}
}

type Reconciler added in v0.1.1

type Reconciler interface {
	Run(stopCh <-chan struct{})
}

Reconciler runs a periodic loop to reconcile the current state of volume back and update backup annotation

type ResourceIdentifier added in v0.1.1

type ResourceIdentifier struct {
	GroupVersion string
	Kind         string
	Namespace    string
	Name         string
}

type Resources added in v0.1.1

type Resources interface {
	Sync(backup *kahuapi.Backup) (*kahuapi.Backup, error)
	GetNamespaces() []string
	GetResourcesByKind(kind string) []*unstructured.Unstructured
	GetClusterScopedResources() []*unstructured.Unstructured
	GetResources() []*unstructured.Unstructured
}

func NewBackupResources added in v0.1.1

func NewBackupResources(
	logger log.FieldLogger,
	dynamicClient dynamic.Interface,
	kubeClient kubernetes.Interface,
	discoveryHelper discovery.DiscoveryHelper,
	updater Updater) Resources

type Updater added in v0.1.1

type Updater interface {
	PatchBackup(oldBackup, newBackup *kahuapi.Backup) (*kahuapi.Backup, error)
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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