Skip to content

Commit

Permalink
Add ControlPlaneWaiters to input for e2e specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed Jul 20, 2022
1 parent 2e73a26 commit c99dbec
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/e2e/cluster_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ClusterUpgradeConformanceSpecInput struct {
ArtifactFolder string
SkipCleanup bool
SkipConformanceTests bool
ControlPlaneWaiters clusterctl.ControlPlaneWaiters

// ControlPlaneMachineCount is used in `config cluster` to configure the count of the control plane machines used in the test.
// Default is 1.
Expand Down Expand Up @@ -131,6 +132,7 @@ func ClusterUpgradeConformanceSpec(ctx context.Context, inputGetter func() Clust
ControlPlaneMachineCount: pointer.Int64Ptr(controlPlaneMachineCount),
WorkerMachineCount: pointer.Int64Ptr(workerMachineCount),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/clusterclass_changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type ClusterClassChangesSpecInput struct {
BootstrapClusterProxy framework.ClusterProxy
ArtifactFolder string
SkipCleanup bool
ControlPlaneWaiters clusterctl.ControlPlaneWaiters

// Flavor is the cluster-template flavor used to create the Cluster for testing.
// NOTE: The template must be using a ClusterClass.
Expand Down Expand Up @@ -130,6 +131,7 @@ func ClusterClassChangesSpec(ctx context.Context, inputGetter func() ClusterClas
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/clusterctl_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type ClusterctlUpgradeSpecInput struct {
PostUpgrade func(managementClusterProxy framework.ClusterProxy)
MgmtFlavor string
WorkloadFlavor string
ControlPlaneWaiters clusterctl.ControlPlaneWaiters
}

// ClusterctlUpgradeSpec implements a test that verifies clusterctl upgrade of a management cluster.
Expand Down Expand Up @@ -163,6 +164,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/k8s_conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type K8SConformanceSpecInput struct {
ArtifactFolder string
SkipCleanup bool
Flavor string
ControlPlaneWaiters clusterctl.ControlPlaneWaiters
}

// K8SConformanceSpec implements a spec that creates a cluster and runs Kubernetes conformance suite.
Expand Down Expand Up @@ -96,6 +97,7 @@ func K8SConformanceSpec(ctx context.Context, inputGetter func() K8SConformanceSp
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(workerMachineCount),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/machine_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type MachinePoolInput struct {
BootstrapClusterProxy framework.ClusterProxy
ArtifactFolder string
SkipCleanup bool
ControlPlaneWaiters clusterctl.ControlPlaneWaiters

// Flavor, if specified must refer to a template that contains a MachinePool resource.
// If not specified, "machine-pool" is used
Expand Down Expand Up @@ -90,6 +91,7 @@ func MachinePoolSpec(ctx context.Context, inputGetter func() MachinePoolInput) {
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(int64(workerMachineCount)),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachinePools: input.E2EConfig.GetIntervals(specName, "wait-machine-pool-nodes"),
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/md_rollout.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type MachineDeploymentRolloutSpecInput struct {
ArtifactFolder string
SkipCleanup bool
Flavor string
ControlPlaneWaiters clusterctl.ControlPlaneWaiters
}

// MachineDeploymentRolloutSpec implements a test that verifies that MachineDeployment rolling updates are successful.
Expand Down Expand Up @@ -83,6 +84,7 @@ func MachineDeploymentRolloutSpec(ctx context.Context, inputGetter func() Machin
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/md_scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type MachineDeploymentScaleSpecInput struct {
ArtifactFolder string
SkipCleanup bool
Flavor string
ControlPlaneWaiters clusterctl.ControlPlaneWaiters
}

// MachineDeploymentScaleSpec implements a test that verifies that MachineDeployment scale operations are successful.
Expand Down Expand Up @@ -84,6 +85,7 @@ func MachineDeploymentScaleSpec(ctx context.Context, inputGetter func() MachineD
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/mhc_remediations.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type MachineRemediationSpecInput struct {
BootstrapClusterProxy framework.ClusterProxy
ArtifactFolder string
SkipCleanup bool
ControlPlaneWaiters clusterctl.ControlPlaneWaiters

// KCPFlavor, if specified, must refer to a template that has a MachineHealthCheck
// resource configured to match the control plane Machines (cluster.x-k8s.io/controlplane: "" label)
Expand Down Expand Up @@ -96,6 +97,7 @@ func MachineRemediationSpec(ctx context.Context, inputGetter func() MachineRemed
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down Expand Up @@ -128,6 +130,7 @@ func MachineRemediationSpec(ctx context.Context, inputGetter func() MachineRemed
ControlPlaneMachineCount: pointer.Int64Ptr(3),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/node_drain_timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ type NodeDrainTimeoutSpecInput struct {
// configured and a MachineDeployment resource that has
// spec.template.spec.nodeDrainTimeout configured.
// If not specified, "node-drain" is used.
Flavor *string
Flavor *string
ControlPlaneWaiters clusterctl.ControlPlaneWaiters
}

func NodeDrainTimeoutSpec(ctx context.Context, inputGetter func() NodeDrainTimeoutSpecInput) {
Expand Down Expand Up @@ -96,6 +97,7 @@ func NodeDrainTimeoutSpec(ctx context.Context, inputGetter func() NodeDrainTimeo
ControlPlaneMachineCount: pointer.Int64Ptr(int64(controlPlaneReplicas)),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/quick_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ type QuickStartSpecInput struct {
// Flavor, if specified is the template flavor used to create the cluster for testing.
// If not specified, and the e2econfig variable IPFamily is IPV6, then "ipv6" is used,
// otherwise the default flavor is used.
Flavor *string
Flavor *string
ControlPlaneWaiters clusterctl.ControlPlaneWaiters
}

// QuickStartSpec implements a spec that mimics the operation described in the Cluster API quick start, that is
Expand Down Expand Up @@ -96,6 +97,7 @@ func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput)
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/self_hosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type SelfHostedSpecInput struct {
ArtifactFolder string
SkipCleanup bool
Flavor string
ControlPlaneWaiters clusterctl.ControlPlaneWaiters
}

// SelfHostedSpec implements a test that verifies Cluster API creating a cluster, pivoting to a self-hosted cluster.
Expand Down Expand Up @@ -94,6 +95,7 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
},
ControlPlaneWaiters: input.ControlPlaneWaiters,
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down

0 comments on commit c99dbec

Please sign in to comment.