utils

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHashKubelet added in v1.0.0

func GetHashKubelet(nodePool *karpv1.NodePool, nodeClass *v1.EC2NodeClass) (string, error)

func GetKubeletConfigurationWithNodeClaim added in v1.0.0

func GetKubeletConfigurationWithNodeClaim(nodeClaim *karpv1.NodeClaim, nodeClass *v1.EC2NodeClass) (*v1.KubeletConfiguration, error)

func GetKubletConfigurationWithNodePool added in v1.0.0

func GetKubletConfigurationWithNodePool(nodePool *karpv1.NodePool, nodeClass *v1.EC2NodeClass) (*v1.KubeletConfiguration, error)

GetKubletConfigurationWithNodePool use the most recent version of the kubelet configuration. The priority of fields is listed below: 1.) v1 NodePool kubelet annotation (Showing a user configured using v1beta1 NodePool at some point) 2.) v1 EC2NodeClass will be used (showing a user configured using v1 EC2NodeClass)

func MergeTags

func MergeTags(tags ...map[string]string) []*ec2.Tag

MergeTags takes a variadic list of maps and merges them together into a list of EC2 tags to be passed into EC2 API calls

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 ResolveNodePoolFromNodeClaim added in v1.0.0

func ResolveNodePoolFromNodeClaim(ctx context.Context, kubeClient client.Client, nodeClaim *karpv1.NodeClaim) (*karpv1.NodePool, error)

func WithDefaultFloat64 added in v1.0.0

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.

Jump to

Keyboard shortcuts

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