Documentation ¶
Index ¶
- Constants
- Variables
- type Plugin
- func (p *Plugin) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error)
- func (p *Plugin) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error)
- func (p *Plugin) DeleteSnapshot(snapshotID string) error
- func (p *Plugin) GetVolumeID(unstructuredPV runtime.Unstructured) (string, error)
- func (p *Plugin) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error)
- func (p *Plugin) Init(config map[string]string) error
- func (p *Plugin) SetOpenEBSAPIClient(c *rest.Config) error
- func (p *Plugin) SetVolumeID(unstructuredPV runtime.Unstructured, volumeID string) (runtime.Unstructured, error)
- type Snapshot
- type Volume
Constants ¶
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-" )
const (
// PvClonePrefix prefix for clone volume in case restore from local backup
PvClonePrefix = "cstor-clone-"
)
Variables ¶
var CVRCheckInterval = 5 * time.Second
CVRCheckInterval defines amount of delay for CVR check
var CVRWaitCount = 100
CVRWaitCount control time limit for waitForAllCVR
var PVCCheckInterval = 5 * time.Second
PVCCheckInterval defines amount of delay for PVC bound check
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 ¶
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 ¶
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 ¶
GetVolumeInfo return volume information for given volume name
func (*Plugin) SetOpenEBSAPIClient ¶ added in v1.11.0
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