import "k8s.io/kubernetes/pkg/volume/util/fsquota"
project.go quota.go quota_linux.go
AssignQuota -- assign a quota to the specified directory. AssignQuota chooses the quota ID based on the pod UID and path. If the pod UID is identical to another one known, it may (but presently doesn't) choose the same quota ID as other volumes in the pod. lint:ignore SA4009 poduid is overwritten by design, see comment below
ClearQuota -- remove the quota assigned to a directory
GetConsumption -- retrieve the consumption (in bytes) of the directory
GetInodes -- retrieve the number of inodes in use under the directory
SupportsQuotas -- Does the path support quotas Cache the applier for paths that support quotas. For paths that don't, don't cache the result because nothing will clean it up. However, do cache the device->applier map; the number of devices is bounded.
type Interface interface { // Does the path provided support quotas, and if so, what types SupportsQuotas(m mount.Interface, path string) (bool, error) // Assign a quota (picked by the quota mechanism) to a path, // and return it. AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error // Get the quota-based storage consumption for the path GetConsumption(path string) (*resource.Quantity, error) // Get the quota-based inode consumption for the path GetInodes(path string) (*resource.Quantity, error) // Remove the quota from a path // Implementations may assume that any data covered by the // quota has already been removed. ClearQuota(m mount.Interface, path string) error }
Interface -- quota interface
Path | Synopsis |
---|---|
common |
Package fsquota imports 17 packages (graph) and is imported by 2 packages. Updated 2020-10-17. Refresh now. Tools for package owners.