Documentation
¶
Index ¶
- Variables
- func DeleteClusterIPs(clusterName, namespace string)
- func GetAutoGenTags(cluster infrav1alpha2.LinodeCluster) []string
- func GetInstanceID(providerID *string) (int, error)
- func GetNextVlanIP(ctx context.Context, clusterName, namespace string, kubeclient client.Client) (string, error)
- func IgnoreLinodeAPIError(err error, codes ...int) error
- func IsLinodePrivateIP(ipAddress string) bool
- func IsRetryableError(err error) bool
- func Pointer[T any](t T) *T
- func SetOwnerReferenceToLinodeCluster(ctx context.Context, k8sclient client.Client, cluster *clusterv1.Cluster, ...) error
- func UnwrapError(err error) error
- type ClusterIPs
- type Filter
- type PostRequestCounter
Constants ¶
This section is empty.
Variables ¶
var ( CreateError = "CreateError" DeleteError = "DeleteError" UpdateError = "UpdateError" UnknownError = "UnknownError" )
List of failure reasons to use in the status fields of our resources
var ( // ErrRateLimit indicates hitting linode API rate limits ErrRateLimit = errors.New("rate-limit exceeded") )
Functions ¶
func DeleteClusterIPs ¶ added in v0.7.0
func DeleteClusterIPs(clusterName, namespace string)
func GetAutoGenTags ¶ added in v0.9.0
func GetAutoGenTags(cluster infrav1alpha2.LinodeCluster) []string
GetAutoGenTags returns tags to be added to linods when a cluster is provisioned using CAPL
func GetInstanceID ¶ added in v0.6.1
GetInstanceID determines the instance ID from the ProviderID
func GetNextVlanIP ¶ added in v0.7.0
func GetNextVlanIP(ctx context.Context, clusterName, namespace string, kubeclient client.Client) (string, error)
GetNextVlanIP returns the next available IP for a cluster
func IgnoreLinodeAPIError ¶
IgnoreLinodeAPIError returns the error except matches to status code
func IsLinodePrivateIP ¶ added in v0.8.5
IsLinodePrivateIP checks if an IP address belongs to the Linode private IP range (192.168.128.0/17)
func IsRetryableError ¶ added in v0.6.0
IsRetryableError determines if the error is retryable, meaning a controller that encounters this error should requeue reconciliation to try again later
func SetOwnerReferenceToLinodeCluster ¶ added in v0.8.8
func SetOwnerReferenceToLinodeCluster(ctx context.Context, k8sclient client.Client, cluster *clusterv1.Cluster, obj client.Object, scheme *runtime.Scheme) error
SetOwnerReferenceToLinodeCluster fetches the LinodeCluster and sets it as the owner reference of a given object.
func UnwrapError ¶ added in v0.2.1
UnwrapError safely unwraps an error until it can't be unwrapped.
Types ¶
type ClusterIPs ¶ added in v0.7.0
type ClusterIPs struct {
// contains filtered or unexported fields
}
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.
type PostRequestCounter ¶ added in v0.6.4
PostRequestCounter keeps track of rate limits for POST to /linode/instances
func GetPostReqCounter ¶ added in v0.6.4
func GetPostReqCounter(tokenHash string) *PostRequestCounter
GetPostReqCounter returns pointer to PostRequestCounter for a given token hash
func (*PostRequestCounter) ApiResponseRatelimitCounter ¶ added in v0.6.4
func (c *PostRequestCounter) ApiResponseRatelimitCounter(resp *resty.Response) error
ApiResponseRatelimitCounter updates ReqRemaining and RefreshTime when a POST call is made to /linode/instances
func (*PostRequestCounter) IsPOSTLimitReached ¶ added in v0.6.4
func (c *PostRequestCounter) IsPOSTLimitReached() bool
IsPOSTLimitReached checks whether POST limits have been reached.
func (*PostRequestCounter) RetryAfter ¶ added in v0.7.0
func (c *PostRequestCounter) RetryAfter() time.Duration
RetryAfter returns how long to wait in seconds for rate-limit to reset