volume

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	VolumeParameterDiskTypeKey     = "diskType"
	VolumeParameterMinCapacityKey  = "minCap"
	VolumeParameterPVCNameKey      = "csi.storage.k8s.io/pvc/name"
	VolumeParameterPVCNameSpaceKey = "csi.storage.k8s.io/pvc/namespace"
	VolumeSelectedNodeKey          = "volume.kubernetes.io/selected-node"
)

consts

View Source
const (
	TopologyNodeKey = "topology.disk.hwameistor.io/node"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskType

type DiskType = string

type Manager

type Manager interface {
	// CreateVolume when volume is not exist
	CreateVolume(name string, volumeRequest interface{}) (*types.Volume, error)

	// UpdateVolume
	UpdateVolume(name string, volumeRequest interface{}) (*types.Volume, error)

	// NodePublishVolume
	NodePublishVolume(ctx context.Context, volumeRequest interface{}) error

	// NodeUnpublishVolume
	NodeUnpublishVolume(ctx context.Context, name, targetPath string) error

	// DeleteVolume
	DeleteVolume(ctx context.Context, name string) error

	// GetVolumeInfo
	GetVolumeInfo(name string) (*types.Volume, error)

	// GetVolumeCapacities
	GetVolumeCapacities() interface{}

	// VolumeIsReady
	VolumeIsReady(name string) (bool, error)

	// VolumeIsExist
	VolumeIsExist(name string) (bool, error)
}

func New

func New() Manager

type VolumeRequest

type VolumeRequest struct {
	// RequireCapacity
	RequireCapacity int64 `json:"capacity"`

	// VolumeContext
	VolumeContext map[string]string `json:"volumeContext"`

	// DiskType represents which disk type is this volume provisioned from
	DiskType DiskType `json:"diskType"`

	// DevPath
	DevPath string `json:"devPath"`

	// PVCName
	PVCName string `json:"pvcName"`

	// PVCNameSpace
	PVCNameSpace string `json:"pvcNameSpace"`

	// OwnerNodeName represents where this disk volume located
	OwnerNodeName string `json:"ownerNodeName"`

	// VolumeCap
	VolumeCap *csi.VolumeCapability

	// VolumeContentSource
	// this field may be needed for volume clone from another disk volume
	// for now, we don't support this
	VolumeContentSource *csi.VolumeContentSource `json:"volumeContentSource"`
}

VolumeRequest

func NewVolumeRequest

func NewVolumeRequest() *VolumeRequest

func (*VolumeRequest) SetDiskType

func (r *VolumeRequest) SetDiskType(diskType string)

func (*VolumeRequest) SetNodeName

func (r *VolumeRequest) SetNodeName(nodeName string)

func (*VolumeRequest) SetPVCName

func (r *VolumeRequest) SetPVCName(pvc string)

func (*VolumeRequest) SetPVCNameSpace

func (r *VolumeRequest) SetPVCNameSpace(ns string)

func (*VolumeRequest) SetRequireCapacity

func (r *VolumeRequest) SetRequireCapacity(cap int64)

func (*VolumeRequest) Valid

func (r *VolumeRequest) Valid() error

Jump to

Keyboard shortcuts

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