datacopy

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 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"
	RCloneKeyDir     = "/root/.ssh"
	RCloneKeyComment = "RClonePubKey"

	RCloneSrcMountPoint      = "/mnt/hwameistor/src/"
	RCloneDstMountPoint      = "/mnt/hwameistor/dst/"
	RClonePubKeyFileName     = "rclone.pub"
	RClonePrivateKeyFileName = "rclone"
	RCloneKeyConfigMapName   = "rclone-key-config"
	RCloneConfigMapName      = "rclone-config"
	RCloneConfigMapKey       = "rclone.conf"
	RCloneCertKey            = "rclone-ssh-keys"
	RcloneJobLabelApp        = "hwameistor-datasync-rclone"

	RCloneConfigSrcNodeNameKey     = "sourceNode"
	RCloneConfigDstNodeNameKey     = "targetNode"
	RCloneConfigVolumeNameKey      = "localVolume"
	RCloneConfigSourceNodeReadyKey = "sourceReady"
	RCloneConfigRemoteNodeReadyKey = "targetReady"
	RCloneConfigSyncDoneKey        = "completed"

	RCloneTrue  string = "yes"
	RCloneFalse string = "no"

	RCloneJobFinalizer = "hwameistor.io/rclone-job-protect"
)
View Source
const (
	DataCopyStatusPending = "pending"
	DataCopyStatusSuccess = "success"
	DataCopyStatusRunning = "running"
	DataCopyStatusFailed  = "failed"
)
View Source
const (
	DefaultCopyTimeout = time.Hour * 48
)

Variables

This section is empty.

Functions

func GetConfigMapName added in v0.4.0

func GetConfigMapName(str1, str2 string) string

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, namespace string) (*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 string, rcloneConfigMapNamespace 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) GenerateRcloneKeyConfigMap added in v0.4.0

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

func (*Rclone) StartRCloneJob added in v0.4.0

func (rcl *Rclone) StartRCloneJob(jobName, lvName, srcNodeName 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