volume

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package volume provides an API for working with volumes on nodes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeVolumeDrivers

func NodeVolumeDrivers(volumeClient clientv1.ClientV1, n *nodesv1.Node) map[DriverType]Driver

NodeVolumeDrivers returns a list of drivers, each configured according to the provided Node spec. If no drivers are configured on the node then the list will be empty

Types

type Attacher

type Attacher interface {
	// PrepareMounts inspects ctr.Config.Mounts, resolves any mount.Volume
	// to a local host path using the appropriate Driver, and updates the
	// mounts with mount.Source = host path.
	PrepareMounts(ctx context.Context, node *nodesv1.Node, ctr *tasksv1.Task) error

	// Allows for reversal of provisioned resources
	Detach(ctx context.Context, node *nodesv1.Node, ctr *tasksv1.Task) error
}

type DefaultAttacher

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

func NewDefaultAttacher

func NewDefaultAttacher(vc clientv1.ClientV1) *DefaultAttacher

NewDefaultAttacher returns a new default attacher

func (*DefaultAttacher) Detach

func (a *DefaultAttacher) Detach(ctx context.Context, n *nodesv1.Node, ctr *tasksv1.Task) error

Detach implements Attacher interface

func (*DefaultAttacher) PrepareMounts

func (a *DefaultAttacher) PrepareMounts(ctx context.Context, n *nodesv1.Node, ctr *tasksv1.Task) error

PrepareMounts implements Attacher interface

type Driver

type Driver interface {
	// Create creates a new volume
	Create(ctx context.Context, name string) (Volume, error)

	// Get gets a volume by name
	Get(ctx context.Context, name string) (Volume, error)

	// Delete removes a volume. The volume must be unmounted before removal
	Delete(ctx context.Context, name string) error

	// List lists all valumes managed by the driver
	List(context.Context) ([]Volume, error)
}

func NewHostLocalManager

func NewHostLocalManager(rootPath string) Driver

func NewTemplateDriver

func NewTemplateDriver(client v1.ClientV1, rootPath string) Driver

type DriverType

type DriverType int32
const (
	DriverTypeUnspecified DriverType = 0
	DriverTypeHostLocal   DriverType = 1
	DriverTypeTemplate    DriverType = 2
)

func GetDriverType

func GetDriverType(vol *volumesv1.Volume) DriverType

func (DriverType) String

func (d DriverType) String() string

type FSVolume

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

func (*FSVolume) ID

func (fs *FSVolume) ID() ID

func (*FSVolume) Location

func (fs *FSVolume) Location() string

func (*FSVolume) Size

func (fs *FSVolume) Size() int64

type ID

type ID string

type MountOpts

type MountOpts func(*Driver)

type Snapshotter

type Snapshotter interface {
	Snapshot(ctx context.Context, vol *Volume) error
}

type Volume

type Volume interface {
	ID() ID
	Size() int64
	Location() string
}

Jump to

Keyboard shortcuts

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