Documentation ¶
Overview ¶
Design for copy data from source PVC to destination PVC, continuously push statue into status channel for notifications
Index ¶
- Constants
- func GetConfigMapName(str1, str2 string) string
- type DataCopyManager
- func (dcm *DataCopyManager) DeregisterRelatedJob(jobName string)
- func (dcm *DataCopyManager) GenerateSyncKeyConfigMap() *corev1.ConfigMap
- func (dcm *DataCopyManager) RegisterRelatedJob(jobName string, resultCh chan *DataCopyStatus)
- func (dcm *DataCopyManager) Run()
- func (dcm *DataCopyManager) Sync(jobName, srcNodeName, dstNodeName, volName string) error
- type DataCopyStatus
- type DataSyncer
- type JuiceSync
- type Progress
Constants ¶
View Source
const ( DefaultCopyTimeout = time.Hour * 48 SyncKeyComment = "SyncPubKey" SyncPubKeyFileName = "key.pub" SyncPrivateKeyFileName = "key" SyncKeyConfigMapName = "sync-key-config" SyncCertKey = "keys-pair" )
View Source
const ( DataCopyStatusPending = "pending" DataCopyStatusSuccess = "success" DataCopyStatusRunning = "running" DataCopyStatusFailed = "failed" )
View Source
const ( SyncSrcName = "source" SyncRemoteName = "remote" SyncConfigMapName = "sync-config" SyncJobLabelApp = "hwameistor-datasync" SyncJobAffinityKey = "kubernetes.io/hostname" SyncSourceMountPoint = "/mnt/hwameistor/src/" SyncTargetMountPoint = "/mnt/hwameistor/dst/" SyncConfigSourceMountPointKey = "sourceMountPoint" SyncConfigTargetMountPointKey = "targetMountPoint" SyncConfigSourceNodeNameKey = "sourceNode" SyncConfigTargetNodeNameKey = "targetNode" SyncConfigVolumeNameKey = "localVolume" SyncConfigSourceNodeReadyKey = "sourceReady" SyncConfigTargetNodeReadyKey = "targetReady" SyncConfigSourceNodeCompleteKey = "sourceCompleted" SyncConfigTargetNodeCompleteKey = "targetCompleted" SyncConfigSyncCompleteKey = "syncCompleted" SyncTrue string = "yes" SyncFalse string = "no" SyncJobFinalizer = "hwameistor.io/sync-job-protect" SyncToolJuiceSync = "juicesync" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigMapName ¶
Types ¶
type DataCopyManager ¶
type DataCopyManager struct {
// contains filtered or unexported fields
}
func NewDataCopyManager ¶
func NewDataCopyManager(ctx context.Context, syncToolName string, 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) GenerateSyncKeyConfigMap ¶
func (dcm *DataCopyManager) GenerateSyncKeyConfigMap() *corev1.ConfigMap
func (*DataCopyManager) RegisterRelatedJob ¶
func (dcm *DataCopyManager) RegisterRelatedJob(jobName string, resultCh chan *DataCopyStatus)
func (*DataCopyManager) Run ¶
func (dcm *DataCopyManager) Run()
func (*DataCopyManager) Sync ¶
func (dcm *DataCopyManager) Sync(jobName, srcNodeName, dstNodeName, volName string) error
type DataCopyStatus ¶
type DataSyncer ¶
Click to show internal directories.
Click to hide internal directories.