migrate

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPatchData

func GetPatchData(oldObj, newObj interface{}) ([]byte, error)

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 Migrator

type Migrator interface {
	Migrate(name, namespace string) error
}

Migrator abstracts the migration of a resource

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

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

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.

Jump to

Keyboard shortcuts

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