volume

package
v0.0.0-...-ac8ee45 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package volume includes internal representations of external volume types as well as utility methods required to mount/unmount volumes to kubelets.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedVolumeType = errors.New("unsupported volume type")

Functions

func GetCurrentVolumes

func GetCurrentVolumes(rootDirectory string) map[string]Cleaner

GetCurrentVolumes examines directory structure to determine volumes that are presently active and mounted. Returns a map of Cleaner types.

Types

type Builder

type Builder interface {
	// Uses Interface to provide the path for Docker binds.
	Interface
	// SetUp prepares and mounts/unpacks the volume to a directory path.
	SetUp() error
}

Builder interface provides method to set up/mount the volume.

func CreateVolumeBuilder

func CreateVolumeBuilder(volume *api.Volume, podID string, rootDir string) (Builder, error)

CreateVolumeBuilder returns a Builder capable of mounting a volume described by an *api.Volume, or an error.

type Cleaner

type Cleaner interface {
	// TearDown unmounts the volume and removes traces of the SetUp procedure.
	TearDown() error
}

Cleaner interface provides method to cleanup/unmount the volumes.

func CreateVolumeCleaner

func CreateVolumeCleaner(kind string, name string, podID string, rootDir string) (Cleaner, error)

CreateVolumeCleaner returns a Cleaner capable of tearing down a volume.

type EmptyDirectory

type EmptyDirectory struct {
	Name    string
	PodID   string
	RootDir string
}

EmptyDirectory volumes are temporary directories exposed to the pod. These do not persist beyond the lifetime of a pod.

func (*EmptyDirectory) GetPath

func (emptyDir *EmptyDirectory) GetPath() string

func (*EmptyDirectory) SetUp

func (emptyDir *EmptyDirectory) SetUp() error

SetUp creates new directory.

func (*EmptyDirectory) TearDown

func (emptyDir *EmptyDirectory) TearDown() error

TearDown simply deletes everything in the directory.

type HostDirectory

type HostDirectory struct {
	Path string
}

HostDirectory volumes represent a bare host directory mount. The directory in Path will be directly exposed to the container.

func (*HostDirectory) GetPath

func (hostVol *HostDirectory) GetPath() string

func (*HostDirectory) SetUp

func (hostVol *HostDirectory) SetUp() error

SetUp implements interface definitions, even though host directory mounts don't require any setup or cleanup.

type Interface

type Interface interface {
	// GetPath returns the directory path the volume is mounted to.
	GetPath() string
}

Interface is a directory used by pods or hosts. All method implementations of methods in the volume interface must be idempotent.

Jump to

Keyboard shortcuts

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