# README

CAPI e2e testing framework

This framework aims to define common end-to-end patterns that can be reused across Cluster API providers.

See https://cluster-api.sigs.k8s.io/developer/e2e.html for more information.

# Packages

Package bootstrap implements bootstrap functionality for e2e testing.
Package clusterctl implements clusterctl interaction.
Package exec implements command execution functionality.
Package ginkgoextensions extends ginkgo.
Package kubernetesversions implements kubernetes version functions.
Package kubetest implmements kubetest functionality.

# Functions

No description provided by the author
No description provided by the author
AddScaleUpDeploymentAndWait create a deployment that will trigger the autoscaler to scale up and create a new machine.
ApplyAutoscalerToWorkloadCluster installs autoscaler on the workload cluster.
AssertControlPlaneFailureDomains will look at all control plane machines and see what failure domains they were placed in.
AssertMachineDeploymentFailureDomains will look at all MachineDeployment machines and see what failure domains they were placed in.
No description provided by the author
No description provided by the author
No description provided by the author
CompleteCommand prints a command before running it.
CreateCluster will create the Cluster and InfraCluster objects.
CreateKubeadmControlPlane creates the control plane object and necessary dependencies.
CreateMachineDeployment creates the machine deployment and dependencies.
CreateNamespace is used to create a namespace object.
CreateNamespaceAndWatchEvents creates a namespace and setups a watch for the namespace events.
CreateRelatedResources is used to create runtime.Objects.
DeleteAllClustersAndWait deletes a cluster object and waits for it to be gone.
DeleteAndWaitMachineDeployment deletes MachineDeployment and waits until it is gone.
DeleteCluster deletes the cluster.
DeleteClusterAndWait deletes a cluster object and waits for it to be gone.
DeleteNamespace is used to delete namespace object.
DeleteScaleUpDeploymentAndWait deletes the scale up deployment and waits for it to be deleted.
DeployEvictablePod will deploy a Deployment on a ControlPlane or MachineDeployment.
DeployPodAndWait will deploy a Deployment on a ControlPlane or MachineDeployment.
DeployUnevictablePod will deploy a Deployment on a ControlPlane or MachineDeployment.
DescribeFailedDeployment returns detailed output to help debug a deployment failure in e2e.
DisableAutoscalerForMachineDeploymentTopologyAndWait drop the autoscaler annotations from the MachineDeploymentTopology and waits till the annotations are dropped from the underlying MachineDeployment.
DisableAutoscalerForMachinePoolTopologyAndWait drop the autoscaler annotations from the MachinePoolTopology and waits till the annotations are dropped from the underlying MachinePool.
DiscoverClusterResourceSetAndWaitForSuccess patches a ClusterResourceSet label to the cluster and waits for resources to be created in that cluster.
DiscoverMachineHealthChecksAndWaitForRemediation patches an unhealthy node condition to one node observed by the Machine Health Check and then wait for remediation.
DiscoveryAndWaitForCluster discovers a cluster object in a namespace and waits for the cluster infrastructure to be provisioned.
DiscoveryAndWaitForControlPlaneInitialized discovers the KubeadmControlPlane object attached to a cluster and waits for it to be initialized.
DiscoveryAndWaitForMachineDeployments discovers the MachineDeployments existing in a cluster and waits for them to be ready (all the machine provisioned).
DiscoveryAndWaitForMachinePools discovers the MachinePools existing in a cluster and waits for them to be ready (all the machines provisioned).
DumpAllResources dumps Cluster API related resources to YAML This dump includes all the types belonging to CAPI providers.
DumpAllResourcesAndLogs dumps all the resources in the spec namespace and the workload cluster.
DumpResourcesForCluster dumps specified resources to yaml.
DumpSpecResourcesAndCleanup dumps all the resources in the spec namespace and cleans up the spec namespace.
No description provided by the author
No description provided by the author
EnsureNamespace verifies if a namespaces exists.
EtcdImageTagCondition returns a podListCondition that ensures the pod image contains the specified image tag.
GatherJUnitReports will move JUnit files from one directory to another, renaming them in a format expected by Prow.
GetAllClustersByNamespace returns the list of Cluster object in a namespace.
GetCAPIResources reads all the CAPI resources in a namespace.
GetClusterByName returns a Cluster object given his name.
GetClusterClassByName returns a ClusterClass object given his name and namespace.
GetClusterResourceSetBindingByCluster returns the ClusterResourceBinding objects for a cluster.
GetClusterResourceSets returns all ClusterResourceSet objects in a namespace.
GetControllerDeployments returns all the deployment for the cluster API controllers existing in a management cluster.
GetControlPlaneMachinesByCluster returns the Machine objects for a cluster.
GetKubeadmControlPlaneByCluster returns the KubeadmControlPlane objects for a cluster.
GetMachineDeploymentsByCluster returns the MachineDeployments objects for a cluster.
GetMachineHealthChecksForCluster returns the MachineHealthCheck objects for a cluster.
GetMachinePoolsByCluster returns the MachinePools objects for a cluster.
GetMachinesByCluster returns Machine objects for a cluster.
GetMachinesByMachineDeployments returns Machine objects for a cluster belonging to a machine deployment.
GetMachinesByMachineHealthCheck returns Machine objects for a cluster that match with MachineHealthCheck selector.
GetMachineSetsByDeployment returns the MachineSets objects for a MachineDeployment.
No description provided by the author
HasOneOfExactOwners is a convenience approach for checking owner references on objects that can have different owner references depending on the cluster.
MachineNodeRefCheck is a MachineStatusCheck ensuring that a NodeRef is assigned to the machine.
MachinePhaseCheck is a MachineStatusCheck ensuring that a machines is in the expected phase.
NewClusterProxy returns a clusterProxy given a KubeconfigPath and the scheme defining the types hosted in the cluster.
ObjectToKind returns the Kind without the package prefix.
PatchClusterLabel patches labels to a cluster.
PatchNodeCondition patches a node condition to any one of the machines with a node ref.
PhasePodCondition is a podListCondition ensuring that pods are in the expected pod phase.
PrettyPrint returns a formatted JSON version of the object given.
No description provided by the author
ResolveArtifactsDirectory attempts to resolve a directory to store test outputs, using either that provided by Prow, or defaulting to _artifacts.
ScaleAndWaitControlPlane scales KCP and waits until all machines have node ref and equal to Replicas.
ScaleAndWaitMachineDeployment scales MachineDeployment and waits until all machines have node ref and equal to Replicas.
ScaleAndWaitMachineDeploymentTopology scales MachineDeployment topology and waits until all machines have node ref and equal to Replicas.
ScaleMachinePoolAndWait scales a machine pool and waits for its instances to scale up.
ScaleMachinePoolTopologyAndWait scales a machine pool and waits for its instances to scale up.
ScaleScaleUpDeploymentAndWait scales the scale up deployment to a given value and waits for it to become ready.
SetupSpecNamespace creates a namespace for the test spec and setups a watch for the namespace events.
TryAddDefaultSchemes tries to add the following schemes: - Kubernetes corev1 - Kubernetes appsv1 - CAPI core - Kubeadm Bootstrapper - Kubeadm ControlPlane Any error that occurs when trying to add the schemes is ignored.
UpgradeClusterTopologyAndWaitForUpgrade upgrades a Cluster topology and waits for it to be upgraded.
UpgradeControlPlaneAndWaitForUpgrade upgrades a KubeadmControlPlane and waits for it to be upgraded.
UpgradeMachineDeploymentInfrastructureRefAndWait upgrades a machine deployment infrastructure ref and waits for its machines to be upgraded.
UpgradeMachineDeploymentInPlaceMutableFieldsAndWait upgrades in-place mutable fields in a MachineDeployment and waits for them to be in-place propagated to MachineSets and Machines.
UpgradeMachineDeploymentsAndWait upgrades a machine deployment and waits for its machines to be upgraded.
UpgradeMachinePoolAndWait upgrades a machine pool and waits for its instances to be upgraded.
ValidateFinalizersResilience checks that expected finalizers are in place, deletes them, and verifies that expected finalizers are properly added again.
ValidateOwnerReferencesOnUpdate checks that expected owner references are updated to the correct apiVersion.
ValidateOwnerReferencesResilience checks that expected owner references are in place, deletes them, and verifies that expect owner references are properly rebuilt.
ValidateResourceVersionStable checks that resource versions are stable.
WaitForClusterDeleted waits until the cluster object has been deleted.
WaitForClusterMachineNodeRefs waits until all nodes associated with a machine deployment exist.
No description provided by the author
WaitForClusterResourceSetToApplyResources wait until all ClusterResourceSet resources are created in the matching cluster.
WaitForClusterToProvision will wait for a cluster to have a phase status of provisioned.
WaitForControlPlaneAndMachinesReady waits for a KubeadmControlPlane object to be ready (all the machine provisioned and one node ready).
WaitForControlPlaneMachinesToBeUpgraded waits until all machines are upgraded to the correct Kubernetes version.
WaitForControlPlaneToBeReady will wait for a control plane to be ready.
WaitForControlPlaneToBeUpToDate will wait for a control plane to be fully up-to-date.
WaitForDeploymentsAvailable waits until the Deployment has status.Available = True, that signals that all the desired replicas are in place.
WaitForDNSUpgrade waits until CoreDNS version matches with the CoreDNS upgrade version and all its replicas are ready for use with the upgraded version.
WaitForKubeadmControlPlaneMachinesToExist will wait until all control plane machines have node refs.
WaitForKubeProxyUpgrade waits until kube-proxy version matches with the kubernetes version.
WaitForMachineDeploymentMachinesToBeUpgraded waits until all machines belonging to a MachineDeployment are upgraded to the correct kubernetes version.
WaitForMachineDeploymentNodesToExist waits until all nodes associated with a machine deployment exist.
WaitForMachineHealthCheckToRemediateUnhealthyNodeCondition patches a node condition to any one of the machines with a node ref.
WaitForMachinePoolInstancesToBeUpgraded waits until all instances belonging to a MachinePool are upgraded to the correct kubernetes version.
WaitForMachinePoolNodesToExist waits until all nodes associated with a machine pool exist.
WaitForMachineStatusCheck waits for the specified status to be true for the machine.
WaitForNodesReady waits until there are exactly the given count nodes and they have the correct Kubernetes version and are ready.
WaitForOneKubeadmControlPlaneMachineToExist will wait until all control plane machines have node refs.
WaitForPodListCondition waits for the specified condition to be true for all pods returned from the list filter.
WatchDaemonSetLogsByLabelSelector streams logs for all containers for all pods belonging to a daemonset on the basis of label.
WatchDeploymentLogsByLabelSelector streams logs for all containers for all pods belonging to a deployment on the basis of label.
WatchDeploymentLogsByName streams logs for all containers for all pods belonging to a deployment.
WatchNamespaceEvents creates a watcher that streams namespace events into a file.
WatchPodMetrics captures metrics from all pods every 5s.
WithCacheOptionsModifier allows to modify the options passed to cache.New the first time it's created.
WithCreateOpts allows definition of the Create options to be used in resource Create.
WithLabelSelector allows definition of the LabelSelector to be used in CreateOrUpdate.
WithMachineLogCollector allows to define the machine log collector to be used with this Cluster.
WithRESTConfigModifier allows to modify the rest config in GetRESTConfig.
WithUpdateOpts allows definition of the Update options to be used in resource Update.

# Variables

CoreFinalizersAssertionWithClassyClusters maps Cluster API core types to their expected finalizers for classy Clusters.
CoreFinalizersAssertionWithLegacyClusters maps Cluster API core types to their expected finalizers for legacy Clusters.
CoreOwnerReferenceAssertion maps Cluster API core types to functions which return an error if the passed OwnerReferences aren't as expected.
DockerInfraFinalizersAssertion maps docker infrastructure resource types to their expected finalizers.
DockerInfraOwnerReferenceAssertions maps Docker Infrastructure types to functions which return an error if the passed OwnerReferences aren't as expected.
ExpFinalizersAssertion maps experimental resource types to their expected finalizers.
ExpOwnerReferenceAssertions maps experimental types to functions which return an error if the passed OwnerReferences aren't as expected.
KubeadmBootstrapOwnerReferenceAssertions maps KubeadmBootstrap types to functions which return an error if the passed OwnerReferences aren't as expected.
KubeadmControlPlaneFinalizersAssertion maps Kubeadm resource types to their expected finalizers.
KubeadmControlPlaneOwnerReferenceAssertions maps Kubeadm control plane types to functions which return an error if the passed OwnerReferences aren't as expected.
KubernetesReferenceAssertions maps Kubernetes types to functions which return an error if the passed OwnerReferences aren't as expected.

# Structs

No description provided by the author
AdditionalLogs is a struct to hold instruction for additional logs that need to be collected.
No description provided by the author
AddScaleUpDeploymentAndWaitInput is the input for AddScaleUpDeploymentAndWait.
ApplyAutoscalerToWorkloadClusterInput is the input for ApplyAutoscalerToWorkloadCluster.
AssertControlPlaneFailureDomainsInput is the input for AssertControlPlaneFailureDomains.
AssertMachineDeploymentFailureDomainsInput is the input for AssertMachineDeploymentFailureDomains.
No description provided by the author
No description provided by the author
CreateClusterInput is the input for CreateCluster.
CreateKubeadmControlPlaneInput is the input for CreateKubeadmControlPlane.
CreateMachineDeploymentInput is the input for CreateMachineDeployment.
CreateNamespaceAndWatchEventsInput is the input type for CreateNamespaceAndWatchEvents.
CreateNamespaceInput is the input type for CreateNamespace.
CreateRelatedResourcesInput is the input type for CreateRelatedResources.
DeleteAllClustersAndWaitInput is the input type for DeleteAllClustersAndWait.
DeleteAndWaitMachineDeploymentInput is the input for DeleteAndWaitMachineDeployment.
DeleteClusterAndWaitInput is the input type for DeleteClusterAndWait.
DeleteClusterInput is the input for DeleteCluster.
DeleteNamespaceInput is the input type for DeleteNamespace.
DeleteScaleUpDeploymentAndWaitInput is the input for DeleteScaleUpDeploymentAndWait.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DiscoverClusterResourceSetAndWaitForSuccessInput is the input for DiscoverClusterResourceSetAndWaitForSuccess.
DiscoverMachineHealthCheckAndWaitForRemediationInput is the input for DiscoverMachineHealthCheckAndWait.
DiscoveryAndWaitForClusterInput is the input type for DiscoveryAndWaitForCluster.
DiscoveryAndWaitForControlPlaneInitializedInput is the input type for DiscoveryAndWaitForControlPlaneInitialized.
DiscoveryAndWaitForMachineDeploymentsInput is the input type for DiscoveryAndWaitForMachineDeployments.
DiscoveryAndWaitForMachinePoolsInput is the input type for DiscoveryAndWaitForMachinePools.
DockerLogCollector collect logs from a CAPD workload cluster.
DumpAllResourcesInput is the input for DumpAllResources.
DumpNamespaceAndGVK specifies a GVK and namespace to be dumped.
DumpResourcesForClusterInput is the input for DumpResourcesForCluster.
No description provided by the author
No description provided by the author
GetAllClustersByNamespaceInput is the input for GetAllClustersByNamespace.
GetCAPIResourcesInput is the input for GetCAPIResources.
GetClusterByNameInput is the input for GetClusterByName.
GetClusterClassByNameInput is the input for GetClusterClassByName.
GetClusterResourceSetBindingByClusterInput is the input for GetClusterResourceSetBindingByCluster.
GetClusterResourceSetsInput is the input for GetClusterResourceSets.
GetControllerDeploymentsInput is the input for GetControllerDeployments.
GetControlPlaneMachinesByClusterInput is the input for GetControlPlaneMachinesByCluster.
GetKubeadmControlPlaneByClusterInput is the input for GetKubeadmControlPlaneByCluster.
GetMachineDeploymentsByClusterInput is the input for GetMachineDeploymentsByCluster.
GetMachineHealthChecksForClusterInput is the input for GetMachineHealthChecksForCluster.
GetMachinePoolsByClusterInput is the input for GetMachinePoolsByCluster.
GetMachinesByClusterInput is the input for GetMachinesByCluster.
GetMachinesByMachineDeploymentsInput is the input for GetMachinesByMachineDeployments.
GetMachinesByMachineHealthCheckInput is the input for GetMachinesByMachineHealthCheck.
GetMachineSetsByDeploymentInput is the input for GetMachineSetsByDeployment.
GetMachinesPoolInstancesInput is the input for GetMachinesPoolInstances.
PatchClusterLabelInput is the input for PatchClusterLabel.
PatchNodeConditionInput is the input for PatchNodeCondition.
No description provided by the author
No description provided by the author
ScaleAndWaitMachineDeploymentInput is the input for ScaleAndWaitMachineDeployment.
ScaleAndWaitMachineDeploymentTopologyInput is the input for ScaleAndWaitMachineDeployment.
No description provided by the author
No description provided by the author
ScaleScaleUpDeploymentAndWaitInput is the input for ScaleScaleUpDeploymentAndWait.
UpgradeClusterTopologyAndWaitForUpgradeInput is the input type for UpgradeClusterTopologyAndWaitForUpgrade.
UpgradeControlPlaneAndWaitForUpgradeInput is the input type for UpgradeControlPlaneAndWaitForUpgrade.
UpgradeMachineDeploymentInfrastructureRefAndWaitInput is the input type for UpgradeMachineDeploymentInfrastructureRefAndWait.
UpgradeMachineDeploymentInPlaceMutableFieldsAndWaitInput is the input type for UpgradeMachineDeploymentInPlaceMutableFieldsAndWait.
UpgradeMachineDeploymentsAndWaitInput is the input type for UpgradeMachineDeploymentsAndWait.
No description provided by the author
WaitForClusterDeletedInput is the input for WaitForClusterDeleted.
WaitForClusterMachineNodeRefsInput is the input for WaitForClusterMachineNodesRefs.
No description provided by the author
WaitForClusterResourceSetToApplyResourcesInput is the input for WaitForClusterResourceSetToApplyResources.
WaitForClusterToProvisionInput is the input for WaitForClusterToProvision.
WaitForControlPlaneAndMachinesReadyInput is the input type for WaitForControlPlaneAndMachinesReady.
WaitForControlPlaneMachinesToBeUpgradedInput is the input for WaitForControlPlaneMachinesToBeUpgraded.
WaitForControlPlaneToBeReadyInput is the input for WaitForControlPlaneToBeReady.
WaitForControlPlaneToBeUpToDateInput is the input for WaitForControlPlaneToBeUpToDate.
WaitForDeploymentsAvailableInput is the input for WaitForDeploymentsAvailable.
WaitForDNSUpgradeInput is the input for WaitForDNSUpgrade.
WaitForKubeadmControlPlaneMachinesToExistInput is the input for WaitForKubeadmControlPlaneMachinesToExist.
WaitForKubeProxyUpgradeInput is the input for WaitForKubeProxyUpgrade.
WaitForMachineDeploymentMachinesToBeUpgradedInput is the input for WaitForMachineDeploymentMachinesToBeUpgraded.
WaitForMachineDeploymentNodesToExistInput is the input for WaitForMachineDeploymentNodesToExist.
WaitForMachineHealthCheckToRemediateUnhealthyNodeConditionInput is the input for WaitForMachineHealthCheckToRemediateUnhealthyNodeCondition.
WaitForMachinePoolInstancesToBeUpgradedInput is the input for WaitForMachinePoolInstancesToBeUpgraded.
WaitForMachinePoolNodesToExistInput is the input for WaitForMachinePoolNodesToExist.
WaitForMachineStatusCheckInput is the input for WaitForMachineStatusCheck.
WaitForNodesReadyInput is the input for WaitForNodesReady.
WaitForOneKubeadmControlPlaneMachineToExistInput is the input for WaitForKubeadmControlPlaneMachinesToExist.
WaitForPodListConditionInput is the input args for WaitForPodListCondition.
WatchDaemonSetLogsByLabelSelectorInput is the input for WatchDaemonSetLogsByLabelSelector.
WatchDeploymentLogsByLabelSelectorInput is the input for WatchDeploymentLogsByLabelSelector.
WatchDeploymentLogsByNameInput is the input for WatchDeploymentLogsByName.
WatchNamespaceEventsInput is the input type for WatchNamespaceEvents.
No description provided by the author

# Interfaces

ClusterLogCollector defines an object that can collect logs from a machine.
ClusterProxy defines the behavior of a type that acts as an intermediary with an existing Kubernetes cluster.
Creator can creates resources.
Deleter can delete resources.
GetLister can get and list resources.
Getter can get resources.
Lister can lists resources.

# Type aliases

CreateOrUpdateOption is a configuration option supplied to CreateOrUpdate.
MachineStatusCheck is a type that operates a status check on a Machine.
Option is a configuration option supplied to NewClusterProxy.
PodListCondition is a type that operates a condition on a Pod.