util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableRawCapacity

func AvailableRawCapacity(hfClientset hfClientset.Interface, capacity hfv1.CMSStruct, virtualMachines []hfv1.VirtualMachine, ctx context.Context) *hfv1.CMSStruct

func EnsureVMNotReady

func EnsureVMNotReady(hfClientset hfClientset.Interface, vmLister hfListers.VirtualMachineLister, vmName string, ctx context.Context) error

func GenKeyPair

func GenKeyPair() (string, string, error)

func GenerateResourceName

func GenerateResourceName(prefix string, input string, hashlength int) string

func GetHTTPErrorCode

func GetHTTPErrorCode(httpStatus int) string

func GetReleaseNamespace added in v1.0.0

func GetReleaseNamespace() string

func MaxVMCountsRaw

func MaxVMCountsRaw(hfClientset hfClientset.Interface, vmTemplates map[string]int, available hfv1.CMSStruct, ctx context.Context) int

func RandStringRunes

func RandStringRunes(n int) string

func ResourceVersionAtLeast

func ResourceVersionAtLeast(curr, min string) bool

borrowed from longhorn

func ReturnHTTPContent

func ReturnHTTPContent(w http.ResponseWriter, r *http.Request, httpStatus int, messageType string, content []byte)

func ReturnHTTPMessage

func ReturnHTTPMessage(w http.ResponseWriter, r *http.Request, httpStatus int, messageType string, message string)

func ReturnHTTPRaw

func ReturnHTTPRaw(w http.ResponseWriter, r *http.Request, content string)

func StringInSlice added in v0.1.8

func StringInSlice(a string, list []string) bool

func UniqueStringSlice

func UniqueStringSlice(stringSlice []string) []string

func VerifySession added in v0.1.8

func VerifySession(sLister hfListers.SessionLister, s *hfv1.Session) error

func VerifyVM

func VerifyVM(vmLister hfListers.VirtualMachineLister, vm *hfv1.VirtualMachine) error

func VerifyVMClaim

func VerifyVMClaim(vmClaimLister hfListers.VirtualMachineClaimLister, vmc *hfv1.VirtualMachineClaim) error

func VerifyVMDeleted

func VerifyVMDeleted(vmLister hfListers.VirtualMachineLister, vm *hfv1.VirtualMachine) error

func VerifyVMSet

func VerifyVMSet(vmSetLister hfListers.VirtualMachineSetLister, vms *hfv1.VirtualMachineSet) error

Types

type HTTPContent

type HTTPContent struct {
	Type    string `json:"type"`
	Status  string `json:"status"`
	Content []byte `json:"content"`
}

type HTTPMessage

type HTTPMessage struct {
	Type    string `json:"type"`
	Status  string `json:"status"`
	Message string `json:"message"`
}

type Maximus

type Maximus struct {
	CapacityMode      hfv1.CapacityMode `json:"capacity_mode"`
	AvailableCount    map[string]int    `json:"available_count"`
	AvailableCapacity hfv1.CMSStruct    `json:"available_capacity"`
}

pending rename...

func MaxAvailableDuringPeriod

func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment string, startString string, endString string, ctx context.Context) (Maximus, error)

Jump to

Keyboard shortcuts

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