subnamespace

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

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) Reconcile

func (r *SubnamespaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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
}

func (*SubnamespaceValidator) Handle

Handle implements the validation webhook

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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