service

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: UPL-1.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ISCSI_SUCCESS            IscsiAdmReturnValues = 0
	ISCSI_ERR_SESS_NOT_FOUND                      = 2
	ISCSI_ERR_TRANS_TIMEOUT                       = 8
	ISCSI_ERR_ISCSID_NOTCONN                      = 20
	ISCSI_ERR_NO_OBJS_FOUND                       = 21
)
View Source
const (
	// Default Log Level
	DefaultLogLevel   = "3"
	DefaultCertPath   = "/mnt/certs/zfssa.crt"
	DefaultCredPath   = "/mnt/zfssa/zfssa.yaml"
	DefaultConfigPath = "/mnt/config/config.yaml"
)
View Source
const (
	// Helpful size constants
	Kib    int64 = 1024
	Mib    int64 = Kib * 1024
	Gib    int64 = Mib * 1024
	Gib100 int64 = Gib * 100
	Tib    int64 = Gib * 1024
	Tib100 int64 = Tib * 100

	DefaultVolumeSizeBytes int64 = 50 * Gib
)
View Source
const (
	UsernamePattern string = `^[a-zA-Z][a-zA-Z0-9_\-\.]*$`
	UsernameLength  int    = 255
)

Variables

This section is empty.

Functions

func GetISCSIDiskMounter

func GetISCSIDiskMounter(iscsiInfo *iscsiDisk, readOnly bool, fsType string, mountOptions []string,
	targetPath string) *iscsiDiskMounter

func GetISCSIDiskUnmounter

func GetISCSIDiskUnmounter(volumeId *utils.VolumeId) *iscsiDiskUnmounter

func GetISCSIInfo

func GetISCSIInfo(ctx context.Context, vid *utils.VolumeId, req *csi.NodePublishVolumeRequest, targetIqn string,
	assignedLunNumber int32) (*iscsiDisk, error)

func GetNodeISCSIInfo

func GetNodeISCSIInfo(vid *utils.VolumeId, req *csi.NodePublishVolumeRequest, targetIqn string, assignedLunNumber int32) (
	*iscsiDisk, error)

func GetNodeList

func GetNodeList() ([]string, error)

Returns the list of nodes in the form of a slice containing their name.

func GetNodeName

func GetNodeName(nodeID string) (string, error)

Returns the node name based on the passed in node ID.

func InitClusterInterface

func InitClusterInterface() error

Initializes the cluster interface.

func NewZFSSANodeServer

func NewZFSSANodeServer(zd *ZFSSADriver) *csi.NodeServer

Types

type ISCSIUtil

type ISCSIUtil struct{}

func (*ISCSIUtil) AttachDisk

func (util *ISCSIUtil) AttachDisk(ctx context.Context, b iscsiDiskMounter, devicePath string) (string, error)

func (*ISCSIUtil) ConnectDisk

func (util *ISCSIUtil) ConnectDisk(ctx context.Context, b iscsiDiskMounter) (string, error)

func (*ISCSIUtil) DetachDisk

func (util *ISCSIUtil) DetachDisk(ctx context.Context, c iscsiDiskUnmounter, targetPath string) error

func (*ISCSIUtil) Rescan

func (util *ISCSIUtil) Rescan(ctx context.Context) (string, error)

type IscsiAdmReturnValues

type IscsiAdmReturnValues int32

A subset of the iscsiadm

type Mounter

type Mounter interface {
	mount.Interface
	GetDeviceName(mountPath string) (string, int, error)
	MakeFile(pathname string) error
	ExistsPath(pathname string) (bool, error)
}

Mounter is an interface for mount operations

type NodeMounter

type NodeMounter struct {
	mount.SafeFormatAndMount
}

func (*NodeMounter) ExistsPath

func (mount *NodeMounter) ExistsPath(pathname string) (bool, error)

Check if a file exists

func (*NodeMounter) GetDeviceName

func (m *NodeMounter) GetDeviceName(mountPath string) (string, int, error)

Retrieve a device name from a mount point (this is a compatibility interface)

func (*NodeMounter) MakeFile

func (mounter *NodeMounter) MakeFile(pathname string) error

Make a file at the pathname

type ZFSSADriver

type ZFSSADriver struct {
	NodeMounter Mounter
	// contains filtered or unexported fields
}

func NewZFSSADriver

func NewZFSSADriver(driverName, version string) (*ZFSSADriver, error)

Creates and returns a new ZFSSA driver structure.

func (*ZFSSADriver) ControllerExpandVolume

func (*ZFSSADriver) ControllerPublishVolume

func (*ZFSSADriver) CreateSnapshot

func (*ZFSSADriver) CreateVolume

func (*ZFSSADriver) DeleteSnapshot

func (*ZFSSADriver) DeleteVolume

func (*ZFSSADriver) GetCapacity

func (*ZFSSADriver) GetPasswordFromCred

func (zd *ZFSSADriver) GetPasswordFromCred() (string, error)

Retrieves just the username from a credential file

func (*ZFSSADriver) GetPluginCapabilities

func (*ZFSSADriver) GetPluginInfo

func (*ZFSSADriver) GetUsernameFromCred

func (zd *ZFSSADriver) GetUsernameFromCred() (string, error)

Retrieves just the username from a credential file (zd.config.CredLocation)

func (*ZFSSADriver) ListSnapshots

func (*ZFSSADriver) ListVolumes

func (*ZFSSADriver) NodeExpandVolume

func (*ZFSSADriver) NodeGetCapabilities

func (*ZFSSADriver) NodeGetInfo

func (*ZFSSADriver) NodeGetVolumeStats

func (*ZFSSADriver) NodePublishVolume

func (*ZFSSADriver) NodeStageBlockVolume

func (zd *ZFSSADriver) NodeStageBlockVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (
	*csi.NodeStageVolumeResponse, error)

Nothing is done

func (*ZFSSADriver) NodeStageVolume

func (*ZFSSADriver) NodeUnpublishVolume

func (*ZFSSADriver) NodeUnstageBlockVolume

func (zd *ZFSSADriver) NodeUnstageBlockVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (
	*csi.NodeUnstageVolumeResponse, error)

func (*ZFSSADriver) NodeUnstageVolume

func (*ZFSSADriver) Probe

func (zd *ZFSSADriver) Probe(ctx context.Context, req *csi.ProbeRequest) (
	*csi.ProbeResponse, error)

This is a readiness probe for the driver, it is for checking if proper drivers are loaded. Typical response to failure is a driver restart.

func (*ZFSSADriver) Run

func (zd *ZFSSADriver) Run()

type ZfssaBlockVolume

type ZfssaBlockVolume struct {
	VolName       string     `json:"volName"`
	VolID         string     `json:"volID"`
	VolSize       int64      `json:"volSize"`
	VolPath       string     `json:"volPath"`
	VolAccessType accessType `json:"volAccessType"`
}

type ZfssaCredentials

type ZfssaCredentials struct {
	Username string `yaml:username`
	Password string `yaml:password`
}

The structured data in the ZFSSA credentials file

Jump to

Keyboard shortcuts

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