emptydir

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFSDevice

func GetFSDevice(dir string) (string, error)

GetFSDevice returns the filesystem device for a given path. To do this we run df on the path, returning a header line and the line we're interested in. The first string token in that line will be the device name.

Types

type EmptyDirQuotaPlugin

type EmptyDirQuotaPlugin struct {
	// wrapped is the actual k8s emptyDir volume plugin we will pass method calls to.
	Wrapped volume.VolumePlugin

	// The default quota to apply to each node:
	Quota resource.Quantity

	// QuotaApplicator is passed to actual volume builders so they can apply
	// quota for the supported filesystem.
	QuotaApplicator QuotaApplicator
}

EmptyDirQuotaPlugin is a simple wrapper for the k8s empty dir plugin builder.

func (*EmptyDirQuotaPlugin) CanSupport

func (plugin *EmptyDirQuotaPlugin) CanSupport(spec *volume.Spec) bool

func (*EmptyDirQuotaPlugin) Init

func (plugin *EmptyDirQuotaPlugin) Init(host volume.VolumeHost) error

func (*EmptyDirQuotaPlugin) Name

func (plugin *EmptyDirQuotaPlugin) Name() string

func (*EmptyDirQuotaPlugin) NewBuilder

func (plugin *EmptyDirQuotaPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, opts volume.VolumeOptions) (volume.Builder, error)

func (*EmptyDirQuotaPlugin) NewCleaner

func (plugin *EmptyDirQuotaPlugin) NewCleaner(volName string, podUID types.UID) (volume.Cleaner, error)

type QuotaApplicator

type QuotaApplicator interface {
	// Apply the quota to the given EmptyDir path:
	Apply(dir string, medium api.StorageMedium, pod *api.Pod, fsGroup *int64, quota resource.Quantity) error
}

QuotaApplicator is used to apply quota to an emptyDir volume.

func NewQuotaApplicator

func NewQuotaApplicator(volumeDirectory string) (QuotaApplicator, error)

NewQuotaApplicator checks the filesystem type for the configured volume directory and returns an appropriate implementation of the quota applicator. If the filesystem does not appear to be a type we support quotas on, an error is returned.

Jump to

Keyboard shortcuts

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