Documentation ¶
Index ¶
- func GetFSDevice(dir string) (string, error)
- type EmptyDirQuotaPlugin
- func (plugin *EmptyDirQuotaPlugin) CanSupport(spec *volume.Spec) bool
- func (plugin *EmptyDirQuotaPlugin) Init(host volume.VolumeHost) error
- func (plugin *EmptyDirQuotaPlugin) Name() string
- func (plugin *EmptyDirQuotaPlugin) NewMounter(spec *volume.Spec, pod *api.Pod, opts volume.VolumeOptions) (volume.Mounter, error)
- func (plugin *EmptyDirQuotaPlugin) NewUnmounter(volName string, podUID types.UID) (volume.Unmounter, error)
- type QuotaApplicator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFSDevice ¶
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 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) 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) NewMounter ¶
func (plugin *EmptyDirQuotaPlugin) NewMounter(spec *volume.Spec, pod *api.Pod, opts volume.VolumeOptions) (volume.Mounter, error)
func (*EmptyDirQuotaPlugin) NewUnmounter ¶
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.
Click to show internal directories.
Click to hide internal directories.