Documentation ¶
Index ¶
- func GetPatchData(oldObj, newObj interface{}) ([]byte, error)
- type CSPCMigrator
- type Migrator
- type SnapshotMigrator
- type VolumeMigrator
- func (v *VolumeMigrator) IsVolumeMounted(pvName string) (*corev1.PersistentVolume, error)
- func (v *VolumeMigrator) Migrate(pvName, openebsNamespace string) error
- func (v *VolumeMigrator) RecreatePV(pvObj *corev1.PersistentVolume) (*corev1.PersistentVolume, error)
- func (v *VolumeMigrator) RecreatePVC(pvcObj *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
- func (v *VolumeMigrator) RetainPV(pvObj *corev1.PersistentVolume) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPatchData ¶
GetPatchData returns patch data by marshalling and taking diff of two objects
Types ¶
type CSPCMigrator ¶
type CSPCMigrator struct { // kubeclientset is a standard kubernetes clientset KubeClientset kubernetes.Interface // openebsclientset is a openebs custom resource package generated for custom API group. OpenebsClientset openebsclientset.Interface CSPCObj *cstor.CStorPoolCluster SPCObj *apis.StoragePoolClaim OpenebsNamespace string CSPCName string }
CSPCMigrator ...
func (*CSPCMigrator) Migrate ¶
func (c *CSPCMigrator) Migrate(name, namespace string) error
Migrate ...
func (*CSPCMigrator) SetCSPCName ¶ added in v1.12.0
func (c *CSPCMigrator) SetCSPCName(name string)
SetCSPCName is used to initialize custom name if provided
type SnapshotMigrator ¶
type SnapshotMigrator struct {
// contains filtered or unexported fields
}
SnapshotMigrator ...
type VolumeMigrator ¶
type VolumeMigrator struct { // kubeclientset is a standard kubernetes clientset KubeClientset kubernetes.Interface // openebsclientset is a openebs custom resource package generated for custom API group. OpenebsClientset openebsclientset.Interface PVName string OpenebsNamespace string CVNamespace string StorageClass *storagev1.StorageClass }
VolumeMigrator ...
func (*VolumeMigrator) IsVolumeMounted ¶
func (v *VolumeMigrator) IsVolumeMounted(pvName string) (*corev1.PersistentVolume, error)
IsVolumeMounted checks if the volume is mounted into any pod. This check is required as if mounted the pod will not allow deleting the pvc for recreation into csi volume.
func (*VolumeMigrator) Migrate ¶
func (v *VolumeMigrator) Migrate(pvName, openebsNamespace string) error
Migrate is the interface implementation for
func (*VolumeMigrator) RecreatePV ¶
func (v *VolumeMigrator) RecreatePV(pvObj *corev1.PersistentVolume) (*corev1.PersistentVolume, error)
RecreatePV recreates PV for the given PV object by first deleting the old PV with same name and creating a new PV having claimRef same as previous PV except for the uid to avoid any other PVC to claim it.
func (*VolumeMigrator) RecreatePVC ¶
func (v *VolumeMigrator) RecreatePVC(pvcObj *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
RecreatePVC recreates PVC for the given PVC object by first deleting the old PVC with same name and creating a new PVC.
func (*VolumeMigrator) RetainPV ¶
func (v *VolumeMigrator) RetainPV(pvObj *corev1.PersistentVolume) error
RetainPV sets the Retain policy on the PV. This operation is performed to prevent deletion of the OpenEBS resources while deleting the pvc to recreate with migrated spec.