resources

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package resources contains utilities to get share resources quantities.

Index

Constants

This section is empty.

Variables

View Source
var WellKnownResources = []string{
	corev1.ResourceCPU.String(),
	corev1.ResourceMemory.String(),
	corev1.ResourceEphemeralStorage.String(),
	corev1.ResourcePods.String(),
}

WellKnownResources contains the well known resources.

Functions

func CPU

func CPU(r corev1.ResourceList) string

CPU returns the CPU quantity as a string.

func EphemeralStorage

func EphemeralStorage(r corev1.ResourceList) string

EphemeralStorage returns the storage quantity as a string.

func GetAcquiredTotal

func GetAcquiredTotal(ctx context.Context, cl client.Client, clusterID string) (corev1.ResourceList, error)

GetAcquiredTotal returns the total acquired resources for a given cluster.

func GetSharedTotal

func GetSharedTotal(ctx context.Context, cl client.Client, clusterID string) (corev1.ResourceList, error)

GetSharedTotal returns the total shared resources for a given cluster.

func Memory

func Memory(r corev1.ResourceList) string

Memory returns the memory quantity as a string.

func Others

func Others(r corev1.ResourceList) map[string]string

Others returns the resources that are not well known.

func Pods

func Pods(r corev1.ResourceList) string

Pods returns the pods quantity as a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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