Documentation ¶
Index ¶
- func GetUpperResourcePoolNameFromParent(sns *objectcontext.ObjectContext, parentSNS *objectcontext.ObjectContext) (string, error)
- func IsUpdateNeeded(sns client.Object, childrenRequests []danav1.Namespaces, ...) bool
- func NamespacesEqual(nsA, nsB []danav1.Namespaces) bool
- func ValidateResourceQuotaParams(snsObject *objectcontext.ObjectContext, isSNSResourcePool bool) admission.Response
- type SubnamespaceReconciler
- type SubnamespaceValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUpperResourcePoolNameFromParent ¶
func GetUpperResourcePoolNameFromParent(sns *objectcontext.ObjectContext, parentSNS *objectcontext.ObjectContext) (string, error)
GetUpperResourcePoolNameFromParent returns the name of the upper ResourcePool of a given subnamespace by looking at its parent.
func IsUpdateNeeded ¶
func IsUpdateNeeded(sns client.Object, childrenRequests []danav1.Namespaces, allocated, free corev1.ResourceList) bool
IsUpdateNeeded gets a subnamespace object, a []danav1.Namespaces and two resource lists and returns whether the subnamespace object status has to be updated.
func NamespacesEqual ¶
func NamespacesEqual(nsA, nsB []danav1.Namespaces) bool
NamespacesEqual gets two []danav1.Namespaces and returns whether they are equal.
func ValidateResourceQuotaParams ¶
func ValidateResourceQuotaParams(snsObject *objectcontext.ObjectContext, isSNSResourcePool bool) admission.Response
ValidateResourceQuotaParams validates that in a regular Subnamespace all quota params: storage, cpu, memory, gpu exists and are positive. In a ResourcePool it validates that the upper resource pool cannot be created with an empty quota.
Types ¶
type SubnamespaceReconciler ¶
type SubnamespaceReconciler struct { client.Client Scheme *runtime.Scheme NSEvents chan event.GenericEvent SNSEvents chan event.GenericEvent NamespaceDB *namespacedb.NamespaceDB }
SubnamespaceReconciler reconciles a Subnamespace object
func (*SubnamespaceReconciler) SetupWithManager ¶
func (r *SubnamespaceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller by specifying the following: controller is managing the reconciliation of subnamespace objects and is watching for changes to the SNSEvents channel and enqueues requests for the associated object.
type SubnamespaceValidator ¶
type SubnamespaceValidator struct { Client client.Client Decoder *admission.Decoder NamespaceDB *namespacedb.NamespaceDB MaxSNS int OnlyRP bool }