utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllSingleValuedRequirementLabels

func GetAllSingleValuedRequirementLabels(instanceType *cloudprovider.InstanceType) map[string]string

GetAllSingleValuedRequirementLabels converts instanceType.Requirements to labels Like instanceType.Requirements.Labels() it uses single-valued requirements Unlike instanceType.Requirements.Labels() it does not filter out restricted Node labels

func GetCapacityTypes

func GetCapacityTypes(spotStrategy string) string

func Hash

func Hash(str string) string

func ParseISO8601

func ParseISO8601(timeStr string) (time.Time, error)

ParseISO8601 parses the given time string into a time.Time object

func ParseInstanceID

func ParseInstanceID(providerID string) (string, error)

ParseInstanceID parses the provider ID stored on the node to get the instance ID associated with a node

func PrettySlice

func PrettySlice[T any](s []T, maxItems int) string

PrettySlice truncates a slice after a certain number of max items to ensure that the Slice isn't too long

func WithDefaultFloat64

func WithDefaultFloat64(key string, def float64) float64

WithDefaultFloat64 returns the float64 value of the supplied environment variable or, if not present, the supplied default value. If the float64 conversion fails, returns the default

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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