cstor

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NAMESPACE config key for OpenEBS namespace
	NAMESPACE = "namespace"

	// LocalSnapshot config key for local snapshot
	LocalSnapshot = "local"

	// SnapshotIDIdentifier is a word to generate snapshotID from volume name and backup name
	SnapshotIDIdentifier = "-velero-bkp-"
)
View Source
const (
	// PvClonePrefix  prefix for clone volume in case restore from local backup
	PvClonePrefix = "cstor-clone-"
)

Variables

View Source
var CVRCheckInterval = 5 * time.Second

CVRCheckInterval defines amount of delay for CVR check

View Source
var CVRWaitCount = 100

CVRWaitCount control time limit for waitForAllCVR

View Source
var PVCCheckInterval = 5 * time.Second

PVCCheckInterval defines amount of delay for PVC bound check

View Source
var PVCWaitCount = 100

PVCWaitCount control time limit for createPVC

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	// Log is used for logging
	Log logrus.FieldLogger

	// K8sClient is used for kubernetes CR operation
	K8sClient *kubernetes.Clientset

	// OpenEBSClient is used for openEBS CR operation
	OpenEBSClient *openebs.Clientset

	// OpenEBSAPIsClient clientset for OpenEBS CR operations
	/*
	   Note: This client comes from openebs/api ( github repo )
	   and this client has the latest cstor v1 APIs.
	   For compatibility this client has also some (not all) v1alpha1 APIs
	   that is present in above OpenEBSClient(this client comes
	   from openebs/maya github repo)
	   Finally, we will migrate to client based on openebs/api.
	*/
	OpenEBSAPIsClient openebsapis.Interface
	// contains filtered or unexported fields
}

Plugin defines snapshot plugin for CStor volume

func (*Plugin) CreateSnapshot

func (p *Plugin) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error)

CreateSnapshot creates snapshot for CStor volume and upload it to cloud storage

func (*Plugin) CreateVolumeFromSnapshot

func (p *Plugin) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error)

CreateVolumeFromSnapshot create CStor volume for given snapshotID and perform restore operation on it

func (*Plugin) DeleteSnapshot

func (p *Plugin) DeleteSnapshot(snapshotID string) error

DeleteSnapshot delete CStor volume snapshot

func (*Plugin) GetVolumeID

func (p *Plugin) GetVolumeID(unstructuredPV runtime.Unstructured) (string, error)

GetVolumeID return volume name for given PV

func (*Plugin) GetVolumeInfo

func (p *Plugin) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error)

GetVolumeInfo return volume information for given volume name

func (*Plugin) Init

func (p *Plugin) Init(config map[string]string) error

Init CStor snapshot plugin

func (*Plugin) SetOpenEBSAPIClient added in v1.11.0

func (p *Plugin) SetOpenEBSAPIClient(c *rest.Config) error

SetOpenEBSAPIClient sets openebs client from openebs/apis Ref: https://github.com/openebs/api/tree/master/pkg/apis

func (*Plugin) SetVolumeID

func (p *Plugin) SetVolumeID(unstructuredPV runtime.Unstructured, volumeID string) (runtime.Unstructured, error)

SetVolumeID set volumeID for given PV

type Snapshot

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

Snapshot describes snapshot object information

type Volume

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

Volume describes volume object information

Jump to

Keyboard shortcuts

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