Documentation ¶
Index ¶
- Constants
- Variables
- func CreateClone(vol *apis.ZFSVolume) error
- func CreateSnapshot(snap *apis.ZFSSnapshot) error
- func CreateVolume(vol *apis.ZFSVolume) error
- func DeleteSnapshot(snapname string) (err error)
- func DeleteVolume(volumeID string) (err error)
- func DestroySnapshot(snap *apis.ZFSSnapshot) error
- func DestroyVolume(vol *apis.ZFSVolume) error
- func FormatAndMountZvol(devicePath string, mountInfo *apis.MountInfo) error
- func GetMounts(dev string) ([]string, error)
- func GetVolList(volumeID string) (*apis.ZFSVolumeList, error)
- func GetVolume(volumeID string) (*apis.ZFSVolume, error)
- func GetVolumeDevPath(vol *apis.ZFSVolume) (string, error)
- func GetVolumeProperty(vol *apis.ZFSVolume, prop string) (string, error)
- func GetVolumeType(fstype string) string
- func GetZFSSnapshot(snapID string) (*apis.ZFSSnapshot, error)
- func GetZFSSnapshotStatus(snapID string) (string, error)
- func GetZFSVolume(volumeID string) (*apis.ZFSVolume, error)
- func IsMountPath(path string) bool
- func MountBlock(vol *apis.ZFSVolume, mountinfo *apis.MountInfo) error
- func MountDataset(vol *apis.ZFSVolume, mount *apis.MountInfo) error
- func MountFilesystem(vol *apis.ZFSVolume, mount *apis.MountInfo) error
- func MountZFSDataset(vol *apis.ZFSVolume, mountpath string) error
- func MountZvol(vol *apis.ZFSVolume, mount *apis.MountInfo) error
- func PropertyChanged(oldVol *apis.ZFSVolume, newVol *apis.ZFSVolume) bool
- func ProvisionSnapshot(snap *apis.ZFSSnapshot) error
- func ProvisionVolume(vol *apis.ZFSVolume) error
- func RemoveSnapFinalizer(snap *apis.ZFSSnapshot) error
- func RemoveZvolFinalizer(vol *apis.ZFSVolume) error
- func ResizeExtn(devpath string) error
- func ResizeVolume(vol *apis.ZFSVolume, newSize int64) error
- func ResizeXFS(path string) error
- func ResizeZFSVolume(vol *apis.ZFSVolume, mountpath string) error
- func SetDatasetMountProp(volume string, mountpath string) error
- func SetVolumeProp(vol *apis.ZFSVolume) error
- func UmountVolume(vol *apis.ZFSVolume, targetPath string) error
- func UmountZFSDataset(vol *apis.ZFSVolume) error
- func UpdateSnapInfo(snap *apis.ZFSSnapshot) error
- func UpdateZvolInfo(vol *apis.ZFSVolume) error
Constants ¶
const ( // OpenEBSNamespace is the environment variable to get openebs namespace // // This environment variable is set via kubernetes downward API OpenEBSNamespaceKey string = "OPENEBS_NAMESPACE" // This environment variable is set via env GoogleAnalyticsKey string = "OPENEBS_IO_ENABLE_ANALYTICS" // ZFSFinalizer for the ZfsVolume CR ZFSFinalizer string = "zfs.openebs.io/finalizer" // ZFSVolKey for the ZfsSnapshot CR to store Persistence Volume name ZFSVolKey string = "openebs.io/persistent-volume" // PoolNameKey is key for ZFS pool name PoolNameKey string = "openebs.io/poolname" // ZFSNodeKey will be used to insert Label in ZfsVolume CR ZFSNodeKey string = "kubernetes.io/nodename" // ZFSTopologyKey is supported topology key for the zfs driver ZFSTopologyKey string = "openebs.io/nodename" // ZFSStatusPending shows object has not handled yet ZFSStatusPending string = "Pending" // ZFSStatusReady shows object has been processed ZFSStatusReady string = "Ready" )
const ( ZFS_DEVPATH = "/dev/zvol/" FSTYPE_ZFS = "zfs" )
zfs related constants
const ( ZFSVolCmd = "zfs" ZFSCreateArg = "create" ZFSCloneArg = "clone" ZFSDestroyArg = "destroy" ZFSSetArg = "set" ZFSGetArg = "get" ZFSListArg = "list" ZFSSnapshotArg = "snapshot" )
zfs command related constants
const ( VOLTYPE_DATASET = "DATASET" VOLTYPE_ZVOL = "ZVOL" )
constants to define volume type
Variables ¶
var ( // OpenEBSNamespace is openebs system namespace OpenEBSNamespace string // NodeID is the NodeID of the node on which the pod is present NodeID string // should send google analytics or not GoogleAnalyticsEnabled string )
Functions ¶
func CreateClone ¶
CreateClone creates clone for the zvol/dataset as per info provided in ZFSVolume object
func CreateSnapshot ¶
func CreateSnapshot(snap *apis.ZFSSnapshot) error
CreateSnapshot creates the zfs volume snapshot
func CreateVolume ¶
CreateVolume creates the zvol/dataset as per info provided in ZFSVolume object
func DeleteSnapshot ¶
DeleteSnapshot deletes the corresponding ZFSSnapshot CR
func DeleteVolume ¶
DeleteVolume deletes the corresponding ZFSVol CR
func DestroySnapshot ¶
func DestroySnapshot(snap *apis.ZFSSnapshot) error
DestroySnapshot deletes the zfs volume snapshot
func DestroyVolume ¶
DestroyVolume deletes the zfs volume
func FormatAndMountZvol ¶
FormatAndMountZvol formats and mounts the created volume to the desired mount path
func GetVolList ¶
func GetVolList(volumeID string) (*apis.ZFSVolumeList, error)
GetVolList fetches the current Published Volume list
func GetVolumeDevPath ¶
GetVolumeDevPath returns devpath for the given volume
func GetVolumeProperty ¶
GetVolumeProperty gets zfs properties for the volume
func GetVolumeType ¶
GetVolumeType returns the volume type whether it is a zvol or dataset
func GetZFSSnapshot ¶
func GetZFSSnapshot(snapID string) (*apis.ZFSSnapshot, error)
GetZFSSnapshot fetches the given ZFSSnapshot
func GetZFSSnapshotStatus ¶
GetZFSSnapshotStatus returns ZFSSnapshot status
func GetZFSVolume ¶
GetZFSVolume fetches the given ZFSVolume
func IsMountPath ¶
IsMountPath returns true if path is a mount path
func MountDataset ¶
MountDataset mounts the zfs dataset to the specified path
func MountFilesystem ¶
MountVolume mounts the disk to the specified path
func MountZFSDataset ¶
MountZFSDataset mounts the dataset to the given mountpoint
func ProvisionSnapshot ¶
func ProvisionSnapshot( snap *apis.ZFSSnapshot, ) error
ProvisionSnapshot creates a ZFSSnapshot CR, watcher for zvc is present in CSI agent
func ProvisionVolume ¶
ProvisionVolume creates a ZFSVolume(zv) CR, watcher for zvc is present in CSI agent
func RemoveSnapFinalizer ¶
func RemoveSnapFinalizer(snap *apis.ZFSSnapshot) error
RemoveSnapFinalizer adds finalizer to ZFSSnapshot CR
func RemoveZvolFinalizer ¶
RemoveZvolFinalizer adds finalizer to ZFSVolume CR
func ResizeExtn ¶
ResizeExtn can be used to run a resize command on the ext2/3/4 filesystem to expand the filesystem to the actual size of the device
func ResizeVolume ¶
ResizeVolume resizes the zfs volume
func ResizeXFS ¶
ResizeXFS can be used to run a resize command on the xfs filesystem to expand the filesystem to the actual size of the device
func SetDatasetMountProp ¶
SetDatasetMountProp sets mountpoint for the volume
func SetVolumeProp ¶
SetVolumeProp sets the volume property
func UmountVolume ¶
UmountVolume unmounts the volume and the corresponding mount path is removed
func UmountZFSDataset ¶
UmountZFSDataset umounts the dataset
func UpdateSnapInfo ¶
func UpdateSnapInfo(snap *apis.ZFSSnapshot) error
UpdateSnapInfo updates ZFSSnapshot CR with node id and finalizer
func UpdateZvolInfo ¶
UpdateZvolInfo updates ZFSVolume CR with node id and finalizer
Types ¶
This section is empty.