volume

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GroupVersion = schema.GroupVersion{
		Group:   group,
		Version: version,
	}
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
	AddToScheme   = SchemeBuilder.AddToScheme
)

Functions

func DeleteVolume

func DeleteVolume(ctx context.Context, vID string) error

func InitializeClient

func InitializeClient(identity string) error

func InitializeFactory

func InitializeFactory(paths []string)

func Provision

func Provision(volumeID string) (string, error)

func Unprovision

func Unprovision(path string) error

Types

type Access

type Access string
const (
	AccessRO Access = "ro"
	AccessRW Access = "rw"
)

type AccessType

type AccessType interface {
	Matches(*csi.NodePublishVolumeRequest) bool
}

type BlockAccessType

type BlockAccessType struct {
	Device string `json:"device"`
	Link   string `json:"link,omitempty"`
	Access Access `json:"access,omitempty"`
}

func (*BlockAccessType) DeepCopyInto

func (in *BlockAccessType) DeepCopyInto(out *BlockAccessType)

func (BlockAccessType) Matches

type FsType

type FsType string
const (
	FsTypeXFS  FsType = "xfs"
	FsTypeExt4 FsType = "ext4"
)

type MountAccessType

type MountAccessType struct {
	FsType     FsType      `json:"fsType"`
	MountFlags []MountFlag `json:"mountFlags"`
	MountPoint string      `json:"mountpoint"`
	Access     Access      `json:"access,omitempty"`
}

func (*MountAccessType) DeepCopyInto

func (in *MountAccessType) DeepCopyInto(out *MountAccessType)

func (MountAccessType) Matches

type MountFlag

type MountFlag string
const (
	MountFlagRO      MountFlag = "ro"
	MountFlagRemount MountFlag = "remount"
)

type MountOption

type MountOption string
const (
	MountOptionBind MountOption = "bind"
)

type Volume

type Volume struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`

	VolumeID           string                       `json:"volumeID"`
	Name               string                       `json:"name,omitempty"`
	VolumeSource       VolumeSource                 `json:"volumeSource,omitempty"`
	VolumeStatus       VolumeStatus                 `json:"volumeStatus"`
	NodeID             string                       `json:"nodeID,omitempty"`
	StagingPath        string                       `json:"stagingPath"`
	VolumeAccessMode   VolumeAccessMode             `json:"volumeAccessMode"`
	BlockAccess        []BlockAccessType            `json:"blockAccess,omitempty"`
	MountAccess        []MountAccessType            `json:"mountAccess,omitempty"`
	PublishContext     map[string]string            `json:"publishContext,omitempty"`
	Parameters         map[string]string            `json:"parameters,omitempty"`
	TopologyConstraint *topology.TopologyConstraint `json:"topologyConstraint,omitempty"`
	AuditTrail         map[time.Time]VolumeStatus   `json:"auditTrail,omitempty"`
}

func GetVolume

func GetVolume(ctx context.Context, vID string) (*Volume, error)

func NewVolume

func NewVolume(ctx context.Context, name string, volumeAccessMode VolumeAccessMode, nodeID string, parameters map[string]string) (*Volume, error)

func (*Volume) Bind

func (v *Volume) Bind(ctx context.Context, targetPath string, readOnly bool, volContext map[string]string) error

Bind binds the volume to a symlink and presents it as a block device inside the container. All access modes are only enforced while provisioning. It is assumed that the container will honor these privileges in good faith

func (*Volume) ContainsTargetPaths

func (v *Volume) ContainsTargetPaths(targetPath string) (AccessType, bool)

func (*Volume) DeepCopy

func (in *Volume) DeepCopy() *Volume

func (*Volume) DeepCopyInto

func (in *Volume) DeepCopyInto(out *Volume)

func (*Volume) DeepCopyObject

func (in *Volume) DeepCopyObject() runtime.Object

func (*Volume) IsBlockAccessible

func (v *Volume) IsBlockAccessible() bool

func (*Volume) IsMountAccessible

func (v *Volume) IsMountAccessible() bool

func (*Volume) Mount

func (v *Volume) Mount(ctx context.Context, targetPath string, fsType string, mountFlags []string, readOnly bool, volContext map[string]string) error

func (*Volume) StageVolume

func (v *Volume) StageVolume(ctx context.Context, volumeID, stagePath string) error

func (*Volume) UnpublishVolume

func (v *Volume) UnpublishVolume(ctx context.Context, targetPath string) error

func (*Volume) UnstageVolume

func (v *Volume) UnstageVolume(ctx context.Context, volumeID, stagePath string) error

type VolumeAccessMode

type VolumeAccessMode int
const (
	VolumeAccessModeUnknown VolumeAccessMode = iota
	VolumeAccessModeSingleNodeWriter
	VolumeAccessModeSingleNodeReadOnly
	VolumeAccessModeMultiNodeReadOnly
	VolumeAccessModeMultiNodeSingleWriter
	VolumeAccessModeMultiNodeMultiWriter
)

func (VolumeAccessMode) IgnoreMarshalJSON

func (v VolumeAccessMode) IgnoreMarshalJSON() ([]byte, error)

func (VolumeAccessMode) IgnoreUnmarshalJSON

func (v VolumeAccessMode) IgnoreUnmarshalJSON(value []byte) error

type VolumeList

type VolumeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Volume `json:"items"`
}

func (*VolumeList) DeepCopy

func (in *VolumeList) DeepCopy() *VolumeList

func (*VolumeList) DeepCopyInto

func (in *VolumeList) DeepCopyInto(out *VolumeList)

func (*VolumeList) DeepCopyObject

func (in *VolumeList) DeepCopyObject() runtime.Object

type VolumeSource

type VolumeSource struct {
	VolumeSourceType VolumeSourceType `json:"volumeSourceType"`
	VolumeSourcePath string           `json:"volumeSourcePath"`
}

func (*VolumeSource) DeepCopyInto

func (in *VolumeSource) DeepCopyInto(out *VolumeSource)

type VolumeSourceType

type VolumeSourceType string
const (
	VolumeSourceTypeBlockDevice VolumeSourceType = "BlockDevice"
	VolumeSourceTypeDirectory   VolumeSourceType = "Directory"
)

type VolumeStatus

type VolumeStatus string
const (
	VolumeStatusCreated   VolumeStatus = "created"
	VolumeStatusNodeReady VolumeStatus = "node-ready"
	VolumeStatusVolReady  VolumeStatus = "vol-ready"
	VolumeStatusPublished VolumeStatus = "published"
)

Jump to

Keyboard shortcuts

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