noderefutil

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 30

Documentation

Overview

Package noderefutil implements NodeRef utils.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyProviderID means that the provider id is empty.
	ErrEmptyProviderID = errors.New("providerID is empty")

	// ErrInvalidProviderID means that the provider id has an invalid form.
	ErrInvalidProviderID = errors.New("providerID must be of the form <cloudProvider>://<optional>/<segments>/<provider id>")
)

Functions

func GetReadyCondition

func GetReadyCondition(status *corev1.NodeStatus) *corev1.NodeCondition

GetReadyCondition extracts the ready condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func IsNodeAvailable

func IsNodeAvailable(node *corev1.Node, minReadySeconds int32, now metav1.Time) bool

IsNodeAvailable returns true if the node is ready and minReadySeconds have elapsed or is 0. False otherwise.

func IsNodeReady

func IsNodeReady(node *corev1.Node) bool

IsNodeReady returns true if a node is ready; false otherwise.

func IsNodeUnreachable added in v0.3.0

func IsNodeUnreachable(node *corev1.Node) bool

IsNodeUnreachable returns true if a node is unreachable. Node is considered unreachable when its ready status is "Unknown".

Types

type ProviderID

type ProviderID struct {
	// contains filtered or unexported fields
}

ProviderID is a struct representation of a Kubernetes ProviderID. Format: cloudProvider://optional/segments/etc/id

func NewProviderID

func NewProviderID(id string) (*ProviderID, error)

NewProviderID parses the input string and returns a new ProviderID.

func (*ProviderID) CloudProvider

func (p *ProviderID) CloudProvider() string

CloudProvider returns the cloud provider portion of the ProviderID.

func (*ProviderID) Equals

func (p *ProviderID) Equals(o *ProviderID) bool

Equals returns true if both the CloudProvider and ID match.

func (*ProviderID) ID

func (p *ProviderID) ID() string

ID returns the identifier portion of the ProviderID.

func (*ProviderID) IndexKey added in v0.4.1

func (p *ProviderID) IndexKey() string

IndexKey returns a string concatenating the cloudProvider and the ID parts of the providerID. E.g Format: cloudProvider://optional/segments/etc/id. IndexKey: cloudProvider/id This is useful to use the providerID as a reliable index between nodes and machines as it guarantees the infra Providers contract.

func (ProviderID) String

func (p ProviderID) String() string

String returns the string representation of this object.

func (*ProviderID) Validate

func (p *ProviderID) Validate() bool

Validate returns true if the provider id is valid.

Jump to

Keyboard shortcuts

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