volumes

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFSType = "ext4"

Variables

View Source
var (
	ErrVolumeNotFound      = errors.New("volume not found")
	ErrVolumeAlreadyExists = errors.New("volume does already exist")
	ErrServerNotFound      = errors.New("server not found")
	ErrAttached            = errors.New("volume is attached")
	ErrNotAttached         = errors.New("volume is not attached")
	ErrAttachLimitReached  = errors.New("max number of attachments per server reached")
	ErrLockedServer        = errors.New("server is locked")
)

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	Name     string
	MinSize  int
	MaxSize  int
	Location string
}

CreateOpts specifies the options for creating a volume.

type IdempotentService

type IdempotentService struct {
	// contains filtered or unexported fields
}

IdempotentService wraps a volume service and provides idempotency as required by the CSI spec.

func NewIdempotentService

func NewIdempotentService(logger log.Logger, volumeService Service) *IdempotentService

func (*IdempotentService) Attach

func (s *IdempotentService) Attach(ctx context.Context, volume *csi.Volume, server *csi.Server) error

func (*IdempotentService) Create

func (s *IdempotentService) Create(ctx context.Context, opts CreateOpts) (*csi.Volume, error)

func (*IdempotentService) Delete

func (s *IdempotentService) Delete(ctx context.Context, volume *csi.Volume) error

func (*IdempotentService) Detach

func (s *IdempotentService) Detach(ctx context.Context, volume *csi.Volume, server *csi.Server) error

func (*IdempotentService) GetByID

func (s *IdempotentService) GetByID(ctx context.Context, id uint64) (*csi.Volume, error)

func (*IdempotentService) GetByName

func (s *IdempotentService) GetByName(ctx context.Context, name string) (*csi.Volume, error)

func (*IdempotentService) Resize

func (s *IdempotentService) Resize(ctx context.Context, volume *csi.Volume, size int) error

type LinuxMountService

type LinuxMountService struct {
	// contains filtered or unexported fields
}

LinuxMountService mounts volumes on a Linux system.

func NewLinuxMountService

func NewLinuxMountService(logger log.Logger) *LinuxMountService

func (*LinuxMountService) PathExists

func (s *LinuxMountService) PathExists(path string) (bool, error)

func (*LinuxMountService) Publish

func (s *LinuxMountService) Publish(volume *csi.Volume, targetPath string, stagingTargetPath string, opts MountOpts) error

func (*LinuxMountService) Stage

func (s *LinuxMountService) Stage(volume *csi.Volume, stagingTargetPath string, opts MountOpts) error

func (*LinuxMountService) Unpublish

func (s *LinuxMountService) Unpublish(volume *csi.Volume, targetPath string) error

func (*LinuxMountService) Unstage

func (s *LinuxMountService) Unstage(volume *csi.Volume, stagingTargetPath string) error

type LinuxResizeService

type LinuxResizeService struct {
	// contains filtered or unexported fields
}

LinuxResizeService resizes volumes on a Linux system.

func NewLinuxResizeService

func NewLinuxResizeService(logger log.Logger) *LinuxResizeService

func (*LinuxResizeService) Resize

func (l *LinuxResizeService) Resize(volume *csi.Volume, volumePath string) error

type LinuxStatsService

type LinuxStatsService struct {
	// contains filtered or unexported fields
}

LinuxStatsService mounts volumes on a Linux system.

func NewLinuxStatsService

func NewLinuxStatsService(logger log.Logger) *LinuxStatsService

func (*LinuxStatsService) ByteFilesystemStats

func (l *LinuxStatsService) ByteFilesystemStats(volumePath string) (totalBytes int64, availableBytes int64, usedBytes int64, err error)

func (*LinuxStatsService) INodeFilesystemStats

func (l *LinuxStatsService) INodeFilesystemStats(volumePath string) (total int64, used int64, free int64, err error)

type MountOpts

type MountOpts struct {
	BlockVolume bool
	FSType      string
	Readonly    bool
	Additional  []string // Additional mount options/flags passed to /bin/mount
}

MountOpts specifies options for mounting a volume.

type MountService

type MountService interface {
	Stage(volume *csi.Volume, stagingTargetPath string, opts MountOpts) error
	Unstage(volume *csi.Volume, stagingTargetPath string) error
	Publish(volume *csi.Volume, targetPath string, stagingTargetPath string, opts MountOpts) error
	Unpublish(volume *csi.Volume, targetPath string) error
	PathExists(path string) (bool, error)
}

MountService mounts volumes.

type ResizeService

type ResizeService interface {
	Resize(volume *csi.Volume, volumePath string) error
}

ResizeService resizes volumes.

type Service

type Service interface {
	Create(ctx context.Context, opts CreateOpts) (*csi.Volume, error)
	GetByID(ctx context.Context, id uint64) (*csi.Volume, error)
	GetByName(ctx context.Context, name string) (*csi.Volume, error)
	Delete(ctx context.Context, volume *csi.Volume) error
	Attach(ctx context.Context, volume *csi.Volume, server *csi.Server) error
	Detach(ctx context.Context, volume *csi.Volume, server *csi.Server) error
	Resize(ctx context.Context, volume *csi.Volume, size int) error
}

type StatsService

type StatsService interface {
	ByteFilesystemStats(volumePath string) (totalBytes int64, availableBytes int64, usedBytes int64, err error)
	INodeFilesystemStats(volumePath string) (total int64, used int64, free int64, err error)
}

StatsService get statistics about mounted volumes.

Jump to

Keyboard shortcuts

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