datacopy

package
v0.3.7-rc.8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 19 Imported by: 4

Documentation

Overview

Design for copy data from source PVC to destination PVC, continuously push statue into status channel for notifications

Index

Constants

View Source
const (
	RcloneSrcName    = "source"
	RcloneRemoteName = "remote"
)
View Source
const (
	DataCopyStatusPending = "pending"
	DataCopyStatusSuccess = "success"
	DataCopyStatusRunning = "running"
	DataCopyStatusFailed  = "failed"
)
View Source
const (
	DefaultCopyTimeout = time.Hour * 48
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataCopyManager

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

func NewDataCopyManager

func NewDataCopyManager(ctx context.Context,
	dataCopyJobStatusAnnotationName string,
	client k8sclient.Client,
	statusCh chan *DataCopyStatus) (*DataCopyManager, error)

NewDataCopyManager return DataCopyManager instance

It will feedback copy process status continuously through statusCh, so it dose not need ResourceReady to poll resource status

func (*DataCopyManager) DeregisterRelatedJob

func (dcm *DataCopyManager) DeregisterRelatedJob(jobName string)

func (*DataCopyManager) RegisterRelatedJob

func (dcm *DataCopyManager) RegisterRelatedJob(jobName string, resultCh chan *DataCopyStatus)

func (*DataCopyManager) Run

func (dcm *DataCopyManager) Run()

func (*DataCopyManager) UseRclone

func (dcm *DataCopyManager) UseRclone(
	rcloneImage,
	rcloneConfigMapName,
	rcloneKeyConfigMapName,
	rcloneConfigMapNamespace,
	rcloneConfigMapKey, rcloneCrtKey string) *Rclone

type DataCopyStatus

type DataCopyStatus struct {
	UserData string
	JobName  string
	Phase    string
	Event    string
	Message  string
	// TODO
	Progress *Progress
}

type Progress

type Progress struct{}

TODO

type Rclone

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

func (*Rclone) EnsureRcloneConfigMapToTargetNamespace

func (rcl *Rclone) EnsureRcloneConfigMapToTargetNamespace(targetNamespace string) error

func (*Rclone) GenerateRcloneKeyConfigMap added in v0.4.0

func (rcl *Rclone) GenerateRcloneKeyConfigMap(ns string) *corev1.ConfigMap

func (*Rclone) SrcMountPointToRemoteMountPoint

func (rcl *Rclone) SrcMountPointToRemoteMountPoint(jobName, namespace, lvPoolName, lvName, srcNodeName, dstNodeName string, waitUntilSuccess bool, timeout time.Duration) error

func (*Rclone) WaitMigrateJobTaskDone

func (rcl *Rclone) WaitMigrateJobTaskDone(jobName, lvName string, waitUntilSuccess bool, timeout time.Duration) error

Jump to

Keyboard shortcuts

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