common

package
v0.2.57-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConsistency = errors.New("consistency error")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps up control plane related management handling.

func New

func New(client client.Client) *Client

New returns a new client with required parameters.

func (*Client) CheckQuotaConsistency

func (c *Client) CheckQuotaConsistency(ctx context.Context, organizationID string, quota *unikornv1.Quota, allocation *unikornv1.Allocation) error

CheckQuotaConsistency by default loads up the organization's quota and all allocations and checks that the total of alloocations does not exceed the quota. If you pass in a quota argument, i.e. when updating the quotas, this will override the read from the organization. If you pass in an allocation, i.e. when creating or updating an allocation, this will be unioned with the organization's allocations, overriding an existing one if it exists.

func (*Client) GetAllocations

func (c *Client) GetAllocations(ctx context.Context, organizationID string) (*unikornv1.AllocationList, error)

func (*Client) GetQuota

func (c *Client) GetQuota(ctx context.Context, organizationID string) (*unikornv1.Quota, bool, error)

func (*Client) ProjectNamespace

func (c *Client) ProjectNamespace(ctx context.Context, organizationID, projectID string) (*corev1.Namespace, error)

Jump to

Keyboard shortcuts

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