domain

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const InternalTemplateKind = "internal"

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalVarsList

type AdditionalVarsList map[string][]byte

type InternalTemplate

type InternalTemplate struct {
	Name string
}

func (InternalTemplate) GetBackupScript

func (it InternalTemplate) GetBackupScript() string

func (InternalTemplate) GetImage

func (it InternalTemplate) GetImage() string

func (InternalTemplate) GetName

func (it InternalTemplate) GetName() string

func (InternalTemplate) GetRestoreScript

func (it InternalTemplate) GetRestoreScript() string

func (InternalTemplate) ProvidesScript

func (it InternalTemplate) ProvidesScript() bool

type KubernetesResource

type KubernetesResource interface {
	GetTypeMeta() *v1.TypeMeta
	GetObjectMeta() *v1.ObjectMeta
}

type Operation

type Operation string
const (
	Download Operation = "download"
	Backup   Operation = "backup"
	Restore  Operation = "restore"
)

type Renderable

type Renderable interface {
	AcceptedResourceTypes() []v1.GroupVersionKind
	GetOperation() Operation
	GetTemplate() Template
	GetScheduledBackup() *v1alpha1.ScheduledBackup
	GetBackupAggregate() *ScheduledBackupAggregate
	GetObjectForOwnerReference() KubernetesResource
	AddOwnedObject(doc *unstructured.Unstructured)
	ShouldRenderDependentObjectsForAllOperationTypes() bool
	ShouldCreateCronJob() bool
}

type RequestedBackupActionAggregate

type RequestedBackupActionAggregate struct {
	*v1alpha1.RequestedBackupAction

	Scheduled *ScheduledBackupAggregate
}

RequestedBackupActionAggregate is aggregating already hydrated (fetched from cache/cluster) objects all together

func (RequestedBackupActionAggregate) AcceptedResourceTypes

func (a RequestedBackupActionAggregate) AcceptedResourceTypes() []v1.GroupVersionKind

todo: move to integration package

func (*RequestedBackupActionAggregate) AddOwnedObject

AddOwnedObject is adding a child element

func (RequestedBackupActionAggregate) GetBackupAggregate

func (RequestedBackupActionAggregate) GetObjectForOwnerReference

func (a RequestedBackupActionAggregate) GetObjectForOwnerReference() KubernetesResource

func (RequestedBackupActionAggregate) GetOperation

func (a RequestedBackupActionAggregate) GetOperation() Operation

func (RequestedBackupActionAggregate) GetReferencesOfOwnedObjects

func (a RequestedBackupActionAggregate) GetReferencesOfOwnedObjects() v1alpha1.ChildrenReferences

func (RequestedBackupActionAggregate) GetScheduledBackup

func (RequestedBackupActionAggregate) GetTemplate

func (a RequestedBackupActionAggregate) GetTemplate() Template

func (*RequestedBackupActionAggregate) MarkAsProcessed

func (a *RequestedBackupActionAggregate) MarkAsProcessed()

func (*RequestedBackupActionAggregate) SetTargetKindType

func (a *RequestedBackupActionAggregate) SetTargetKindType(name string)

func (RequestedBackupActionAggregate) ShouldCreateCronJob

func (sb RequestedBackupActionAggregate) ShouldCreateCronJob() bool

func (*RequestedBackupActionAggregate) ShouldRenderDependentObjectsForAllOperationTypes

func (a *RequestedBackupActionAggregate) ShouldRenderDependentObjectsForAllOperationTypes() bool

func (RequestedBackupActionAggregate) WasAlreadyProcessed

func (a RequestedBackupActionAggregate) WasAlreadyProcessed() bool

type ResourceTypes

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

func NewResourceTypesFilterForRequestedBackupAction

func NewResourceTypesFilterForRequestedBackupAction() ResourceTypes

NewResourceTypesFilterForRequestedBackupAction decides that RequestedBackupAction is owning only runnable objects (JOBS)

func NewResourceTypesFilterForScheduledBackup

func NewResourceTypesFilterForScheduledBackup(resource Renderable, op Operation) ResourceTypes

NewResourceTypesFilterForScheduledBackup decides that ScheduledBackup owns all helper objects like Secrets, ConfigMaps for all kinds of actions for example app1-backup, app1-restore configmaps would be created at once

IMPORTANT: There are no Jobs maintained by ScheduledBackup CRDs

The runnable Jobs are maintained by RequestedBackupAction

The ScheduledBackup is optionally managing CronJobs, which are spawning Jobs according to how Kubernetes works by default

func (*ResourceTypes) GetKinds

func (rt *ResourceTypes) GetKinds() []v1.GroupVersionKind

type ScheduledBackupAggregate

type ScheduledBackupAggregate struct {
	*v1alpha1.ScheduledBackup

	Template           Template
	GPGSecret          *v1.Secret
	TokenSecret        *v1.Secret
	VarsListSecret     *v1.Secret
	AdditionalVarsList AdditionalVarsList
}

ScheduledBackupAggregate is aggregating already hydrated (fetched from cache/cluster) objects all together

func (ScheduledBackupAggregate) AcceptedResourceTypes

func (sb ScheduledBackupAggregate) AcceptedResourceTypes() []metav1.GroupVersionKind

func (*ScheduledBackupAggregate) AddOwnedObject

func (sb *ScheduledBackupAggregate) AddOwnedObject(doc *unstructured.Unstructured)

AddOwnedObject is adding a child element

func (ScheduledBackupAggregate) GetBackupAggregate

func (sb ScheduledBackupAggregate) GetBackupAggregate() *ScheduledBackupAggregate

func (ScheduledBackupAggregate) GetObjectForOwnerReference

func (sb ScheduledBackupAggregate) GetObjectForOwnerReference() KubernetesResource

func (ScheduledBackupAggregate) GetOperation

func (sb ScheduledBackupAggregate) GetOperation() Operation

func (ScheduledBackupAggregate) GetReferencesOfOwnedObjects

func (sb ScheduledBackupAggregate) GetReferencesOfOwnedObjects() v1alpha1.ChildrenReferences

func (ScheduledBackupAggregate) GetScheduledBackup

func (sb ScheduledBackupAggregate) GetScheduledBackup() *v1alpha1.ScheduledBackup

func (ScheduledBackupAggregate) GetTemplate

func (sb ScheduledBackupAggregate) GetTemplate() Template

func (ScheduledBackupAggregate) ShouldCreateCronJob

func (sb ScheduledBackupAggregate) ShouldCreateCronJob() bool

func (*ScheduledBackupAggregate) ShouldRenderDependentObjectsForAllOperationTypes

func (sb *ScheduledBackupAggregate) ShouldRenderDependentObjectsForAllOperationTypes() bool

type Template

type Template interface {
	GetImage() string
	GetBackupScript() string
	GetRestoreScript() string
	ProvidesScript() bool
	GetName() string
}

Jump to

Keyboard shortcuts

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