Documentation ¶
Index ¶
- func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity, ...) error
- func ClearQuota(m mount.Interface, path string, userNamespacesEnabled bool) error
- func GetConsumption(path string) (*resource.Quantity, error)
- func GetInodes(path string) (*resource.Quantity, error)
- func GetQuotaOnDir(m mount.Interface, path string) (common.QuotaID, error)
- func SupportsQuotas(m mount.Interface, path string, userNamespacesEnabled bool) (bool, error)
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignQuota ¶
func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity, userNamespacesEnabled bool) error
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.
func ClearQuota ¶
ClearQuota -- remove the quota assigned to a directory
func GetConsumption ¶
GetConsumption -- retrieve the consumption (in bytes) of the directory
func GetQuotaOnDir ¶ added in v1.24.13
func SupportsQuotas ¶
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. User namespaces prevent changes to project IDs on the filesystem, ensuring xfs-quota metrics' reliability; hence, userNamespacesEnabled is checked.
Types ¶
type Interface ¶
type Interface interface { // GetQuotaOnDir gets the quota ID (if any) that applies to // this directory GetQuotaOnDir(m mount.Interface, path string) (common.QuotaID, error) // 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