volume

package
v0.0.0-...-6eef5cf Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2014 License: Apache-2.0 Imports: 4 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

This section is empty.

Types

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 the new directory.

func (*EmptyDirectory) TearDown

func (emptyDir *EmptyDirectory) TearDown() error

TODO(jonesdl) when we can properly invoke TearDown(), we should delete the directory created by SetUp.

type HostDirectory

type HostDirectory struct {
	Path string
}

Host Directory 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

Host directory mounts require no setup or cleanup, but still need to fulfill the interface definitions.

func (*HostDirectory) TearDown

func (hostVol *HostDirectory) TearDown() error

type Interface

type Interface interface {
	// SetUp prepares and mounts/unpacks the volume to a directory path.
	SetUp() error

	// GetPath returns the directory path the volume is mounted to.
	GetPath() string

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

Interface is a directory used by pods or hosts. Interface implementations must be idempotent.

func CreateVolume

func CreateVolume(volume *api.Volume, podID string, rootDir string) (Interface, error)

CreateVolume returns an Interface capable of mounting a volume described by an *api.Volume and whether or not it is mounted, or an error.

Jump to

Keyboard shortcuts

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