Documentation
¶
Index ¶
- func CheapestInstanceType(instanceTypes []*cloudprovider.InstanceType) (*cloudprovider.InstanceType, error)
- func DedupeTags(tags []string) []string
- func FilterInstanceTypes(ctx context.Context, instanceTypes []*cloudprovider.InstanceType, ...) ([]*cloudprovider.InstanceType, error)
- func GetNodeClassHash(nodeClass *v1.LinodeNodeClass) string
- func GetTags(nodeClass *v1.LinodeNodeClass, nodeClaim *karpv1.NodeClaim, clusterName string) map[string]string
- func GetTagsForLKE(nodeClass *v1.LinodeNodeClass, nodeClaim *karpv1.NodeClaim, clusterName string) map[string]string
- func MapToTagList(m map[string]string) []string
- func ParseInstanceID(providerID string) (string, error)
- func PrettySlice[T any](s []T, maxItems int) string
- func TagListToMap(tags []string) map[string]string
- func UpdateUnavailableOfferingsCache(ctx context.Context, err error, capacityType string, region string, ...)
- func WithDefaultFloat64(key string, def float64) float64
- type Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheapestInstanceType ¶
func CheapestInstanceType(instanceTypes []*cloudprovider.InstanceType) (*cloudprovider.InstanceType, error)
CheapestInstanceType returns the lowest-price instance type from the set.
func DedupeTags ¶
func FilterInstanceTypes ¶
func FilterInstanceTypes(ctx context.Context, instanceTypes []*cloudprovider.InstanceType, nodeClaim *karpv1.NodeClaim) ([]*cloudprovider.InstanceType, error)
FilterInstanceTypes applies common filters to available instance types.
func GetNodeClassHash ¶
func GetNodeClassHash(nodeClass *v1.LinodeNodeClass) string
func GetTagsForLKE ¶
func MapToTagList ¶
func ParseInstanceID ¶
ParseInstanceID parses the provider ID stored on the node to get the instance ID associated with a node
func PrettySlice ¶
PrettySlice truncates a slice after a certain number of max items to ensure that the Slice isn't too long
func TagListToMap ¶
func UpdateUnavailableOfferingsCache ¶
func UpdateUnavailableOfferingsCache( ctx context.Context, err error, capacityType string, region string, instanceType *cloudprovider.InstanceType, unavailableOfferings *linodecache.UnavailableOfferings, )
func WithDefaultFloat64 ¶
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 ¶
type Filter ¶
type Filter struct {
ID *int // Filter on the resource's ID (most specific).
Label string // Filter on the resource's label.
Tags []string // Filter resources by their tags (least specific).
AdditionalFilters map[string]string // Filter resources by additional parameters
}
Filter holds the fields used for filtering results from the Linode API.
The fields within Filter are prioritized so that only the most-specific field is present when Filter is marshaled to JSON.
func (Filter) MarshalJSON ¶
MarshalJSON returns a JSON-encoded representation of a Filter. The resulting encoded value will have exactly 1 (one) field present. See Filter for details on the value precedence.