package
0.2.0-alpha.14
Repository: https://github.com/onexstack/onex.git
Documentation: pkg.go.dev

# Functions

ChainToTypedObjectsMapper returns a mapper function that gets a cluster and lists all objects for the object passed in and returns a list of requests.
EnsureOwnerRef makes sure the slice contains the OwnerReference.
GetChainByName finds and return a Chain object using the specified params.
GetChainFromMetadata returns the Chain object (if present) using the object metadata.
GetGVKMetadata retrieves a CustomResourceDefinition metadata from the API server using partial object metadata.
GetMinerByName finds and return a Miner object using the specified params.
GetMinerIfExists gets a miner from the API server if it exists.
GetOwnerChain returns the Chain object owning the current resource.
GetOwnerMiner returns the Miner object owning the current resource.
HasOwner checks if any of the references in the passed list match the given group from apiVersion and one of the given kinds.
HasOwnerRef returns true if the OwnerReference is already in the slice.
IsControlledBy differs from metav1.IsControlledBy.
IsExternalManagedControlPlane returns a bool indicating whether the control plane referenced in the passed Unstructured resource is an externally managed control plane such as AKS, EKS, GKE, etc.
IsNil returns an error if the passed interface is equal to nil or if it has an interface value of nil.
IsNodeReady returns true if a node is ready.
IsOwnedByObject returns true if any of the owner references point to the given target.
IsSupportedVersionSkew will return true if a and b are no more than one minor version off from each other.
LowestNonZeroInt32 returns the lowest non-zero value of the two provided values.
LowestNonZeroResult compares two reconciliation results and returns the one with lowest requeue time.
MergeMap merges maps.
ObjectKey returns client.ObjectKey for the object.
ObjectReferenceToUnstructured converts an object reference to an unstructured object.
Ordinalize takes an int and returns the ordinalized version of it.
RandomString returns a random alphanumeric string.
RemoveOwnerRef returns the slice of owner references after removing the supplied owner ref.
ReplaceOwnerRef re-parents an object from one OwnerReference to another It compares strictly based on UID to avoid reparenting across an intentional deletion: if an object is deleted and re-created with the same name and namespace, the only way to tell there was an in-progress deletion is by comparing the UIDs.
UnstructuredUnmarshalField is a wrapper around json and unstructured objects to decode and copy a specific field value into an object.

# Constants

CharSet defines the alphanumeric set for random string generation.

# Variables

ErrNoChain is returned when the cluster label could not be found on the object passed in.
ErrUnstructuredFieldNotFound determines that a field in an unstructured object could not be found.

# Type aliases

KubeAwareAPIVersions is a sortable slice of kube-like version strings.