elasticquota

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQuotaName added in v1.1.0

func GetQuotaName(pod *corev1.Pod, kubeClient client.Client) string

func NewQuotaTopology

func NewQuotaTopology(client client.Client) *quotaTopology

Types

type QuotaCalculateInfo

type QuotaCalculateInfo struct {
	// The semantics of "max" is the quota group's upper limit of resources.
	Max v1.ResourceList
	// The semantics of "min" is the quota group's guaranteed resources, if quota group's "request" less than or
	// equal to "min", the quota group can obtain equivalent resources to the "request"
	Min v1.ResourceList

	Guaranteed v1.ResourceList
	Allocated  v1.ResourceList
}

type QuotaInfo

type QuotaInfo struct {
	IsParent          bool
	AllowLentResource bool
	AllowForceUpdate  bool
	Name              string
	ParentName        string
	TreeID            string
	IsTreeRoot        bool
	CalculateInfo     QuotaCalculateInfo
}

func NewQuotaInfo

func NewQuotaInfo(isParent, allowLentResource bool, name, parentName string) *QuotaInfo

func NewQuotaInfoFromQuota

func NewQuotaInfoFromQuota(quota *v1alpha1.ElasticQuota) *QuotaInfo

func (*QuotaInfo) GetQuotaSummary

func (qi *QuotaInfo) GetQuotaSummary() *QuotaInfoSummary

type QuotaInfoSummary

type QuotaInfoSummary struct {
	Name              string `json:"name"`
	ParentName        string `json:"parentName"`
	IsParent          bool   `json:"isParent"`
	AllowLentResource bool   `json:"allowLentResource"`

	Max v1.ResourceList `json:"max"`
	Min v1.ResourceList `json:"min"`
}

func NewQuotaInfoSummary

func NewQuotaInfoSummary() *QuotaInfoSummary

type QuotaMetaChecker

type QuotaMetaChecker struct {
	client.Client
	*admission.Decoder
	QuotaTopo *quotaTopology
}

func NewPlugin

func NewPlugin(decoder *admission.Decoder, client client.Client) *QuotaMetaChecker

func (*QuotaMetaChecker) AdmitQuota

func (c *QuotaMetaChecker) AdmitQuota(ctx context.Context, req admission.Request, obj runtime.Object) error

func (*QuotaMetaChecker) GetQuotaInfo added in v1.4.1

func (c *QuotaMetaChecker) GetQuotaInfo(name, namespace string) *QuotaInfo

func (*QuotaMetaChecker) GetQuotaTopologyInfo

func (c *QuotaMetaChecker) GetQuotaTopologyInfo() *QuotaTopologySummary

func (*QuotaMetaChecker) ValidatePod

func (c *QuotaMetaChecker) ValidatePod(ctx context.Context, req admission.Request) error

func (*QuotaMetaChecker) ValidateQuota

func (c *QuotaMetaChecker) ValidateQuota(ctx context.Context, req admission.Request, obj runtime.Object) error

type QuotaTopologySummary

type QuotaTopologySummary struct {
	QuotaInfoMap       map[string]*QuotaInfoSummary `json:"quotaInfoMap"`
	QuotaHierarchyInfo map[string][]string          `json:"quotaHierarchyInfo"`
}

func NewQuotaTopologySummary

func NewQuotaTopologySummary() *QuotaTopologySummary

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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