emptydir

package
v3.9.0-alpha.4+incompa... Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: Apache-2.0 Imports: 8 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 {
	// the actual k8s emptyDir volume plugin we will pass method calls to.
	// TODO: do we need to implement unmount
	volume.VolumePlugin

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

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

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

func (*EmptyDirQuotaPlugin) NewMounter added in v1.3.0

func (plugin *EmptyDirQuotaPlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, opts volume.VolumeOptions) (volume.Mounter, error)

type QuotaApplicator

type QuotaApplicator interface {
	// Apply the quota to the given EmptyDir path:
	Apply(dir string, medium v1.StorageMedium, pod *v1.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