machinefilters

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdoptableControlPlaneMachines added in v0.3.7

func AdoptableControlPlaneMachines(clusterName string) func(machine *clusterv1.Machine) bool

AdoptableControlPlaneMachines returns a filter to find all un-controlled control plane machines. Usage: managementCluster.GetMachinesForCluster(ctx, cluster, AdoptableControlPlaneMachines(cluster.Name, controlPlane))

func ControlPlaneMachines added in v0.3.7

func ControlPlaneMachines(clusterName string) func(machine *clusterv1.Machine) bool

ControlPlaneMachines returns a filter to find all control plane machines for a cluster, regardless of ownership. Usage: managementCluster.GetMachinesForCluster(ctx, cluster, machinefilters.ControlPlaneMachines(cluster.Name))

func ControlPlaneSelectorForCluster added in v0.3.7

func ControlPlaneSelectorForCluster(clusterName string) labels.Selector

ControlPlaneSelectorForCluster returns the label selector necessary to get control plane machines for a given cluster.

func HasControllerRef added in v0.3.7

func HasControllerRef(machine *clusterv1.Machine) bool

HasControllerRef is a filter that returns true if the machine has a controller ref

func HasDeletionTimestamp

func HasDeletionTimestamp(machine *clusterv1.Machine) bool

HasDeletionTimestamp returns a filter to find all machines that have a deletion timestamp.

func HasUnhealthyCondition added in v0.3.11

func HasUnhealthyCondition(machine *clusterv1.Machine) bool

HasUnhealthyCondition returns a filter to find all machines that have a MachineHealthCheckSucceeded condition set to False, indicating a problem was detected on the machine, and the MachineOwnerRemediated condition set, indicating that KCP is responsible of performing remediation as owner of the machine.

func MatchesKCPConfiguration added in v0.3.7

func MatchesKCPConfiguration(infraConfigs map[string]*unstructured.Unstructured, machineConfigs map[string]*bootstrapv1.KubeadmConfig, kcp *controlplanev1.KubeadmControlPlane) func(machine *clusterv1.Machine) bool

MatchesKCPConfiguration returns a filter to find all machines that matches with KCP config and do not require any rollout. Kubernetes version, infrastructure template, and KubeadmConfig field need to be equivalent.

func OwnedMachines added in v0.3.7

func OwnedMachines(owner controllerutil.Object) func(machine *clusterv1.Machine) bool

OwnedMachines returns a filter to find all owned control plane machines. Usage: managementCluster.GetMachinesForCluster(ctx, cluster, machinefilters.OwnedMachines(controlPlane))

Types

type Func

type Func func(machine *clusterv1.Machine) bool

func And

func And(filters ...Func) Func

And returns a filter that returns true if all of the given filters returns true.

func HasAnnotationKey

func HasAnnotationKey(key string) Func

HasAnnotationKey returns a filter to find all machines that have the specified Annotation key present

func InFailureDomains

func InFailureDomains(failureDomains ...*string) Func

InFailureDomains returns a filter to find all machines in any of the given failure domains

func IsReady added in v0.3.7

func IsReady() Func

IsReady returns a filter to find all machines with the ReadyCondition equals to True.

func MatchesKubeadmBootstrapConfig added in v0.3.7

func MatchesKubeadmBootstrapConfig(machineConfigs map[string]*bootstrapv1.KubeadmConfig, kcp *controlplanev1.KubeadmControlPlane) Func

MatchesKubeadmBootstrapConfig checks if machine's KubeadmConfigSpec is equivalent with KCP's KubeadmConfigSpec.

func MatchesKubernetesVersion added in v0.3.7

func MatchesKubernetesVersion(kubernetesVersion string) Func

MatchesKubernetesVersion returns a filter to find all machines that match a given Kubernetes version.

func MatchesTemplateClonedFrom added in v0.3.7

func MatchesTemplateClonedFrom(infraConfigs map[string]*unstructured.Unstructured, kcp *controlplanev1.KubeadmControlPlane) Func

MatchesTemplateClonedFrom returns a filter to find all machines that match a given KCP infra template.

func Not

func Not(mf Func) Func

Not returns a filter that returns the opposite of the given filter.

func Or

func Or(filters ...Func) Func

Or returns a filter that returns true if any of the given filters returns true.

func ShouldRolloutAfter added in v0.3.7

func ShouldRolloutAfter(reconciliationTime, rolloutAfter *metav1.Time) Func

ShouldRolloutAfter returns a filter to find all machines where CreationTimestamp < rolloutAfter < reconciliationTIme

Jump to

Keyboard shortcuts

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