Skip to content

Commit

Permalink
Fix create cluster template
Browse files Browse the repository at this point in the history
  • Loading branch information
willie-yao committed Sep 27, 2023
1 parent 13c3201 commit 5d5e08b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/v1beta1/azuremanagedcontrolplane_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ func TestAzureManagedControlPlane_ValidateCreate(t *testing.T) {
name: "invalid DNSServiceIP",
amcp: createAzureManagedControlPlane("192.168.0.10.3", "v1.18.0", generateSSHPublicKey(true)),
wantErr: true,
errorLen: 1,
errorLen: 2,
},
{
name: "invalid DNSServiceIP",
Expand All @@ -1091,7 +1091,7 @@ func TestAzureManagedControlPlane_ValidateCreate(t *testing.T) {
name: "invalid sshKey with a simple text and invalid DNSServiceIP",
amcp: createAzureManagedControlPlane("192.168.0.10.3", "v1.18.0", "invalid_sshkey_honk"),
wantErr: true,
errorLen: 2,
errorLen: 3,
},
{
name: "invalid version",
Expand Down
27 changes: 19 additions & 8 deletions test/e2e/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,16 +843,21 @@ var _ = Describe("Workload cluster creation", func() {
})

Context("Creating an AKS cluster using ClusterClass [Managed Kubernetes]", func() {
// use ci-default as the clusterclass name so test infra can find the clusterclass template
os.Setenv("CLUSTER_CLASS_NAME", "ci-default")
It("with a single control plane node, one linux worker node, and one windows worker node", func() {
// use ci-default as the clusterclass name so test infra can find the clusterclass template
os.Setenv("CLUSTER_CLASS_NAME", "ci-default")

It("with a single control plane node and 1 node", func() {
clusterName = getClusterName(clusterNamePrefix, aksClusterNameSuffix)
// use "cc" as spec name because natgw pip name exceeds limit.
clusterName = getClusterName(clusterNamePrefix, "cc")
kubernetesVersionUpgradeFrom, err := GetAKSKubernetesVersion(ctx, e2eConfig, AKSKubernetesVersionUpgradeFrom)
Expect(err).To(BeNil())
kubernetesVersion, err := GetAKSKubernetesVersion(ctx, e2eConfig, AKSKubernetesVersion)
Expect(err).To(BeNil())

// Opt into using windows with prow template
Expect(os.Setenv("WINDOWS_WORKER_MACHINE_COUNT", "1")).To(Succeed())

// Create a cluster using the cluster class created above
clusterctl.ApplyClusterTemplateAndWait(ctx, createApplyClusterTemplateInput(
specName,
withFlavor("aks-clusterclass"),
Expand All @@ -861,11 +866,17 @@ var _ = Describe("Workload cluster creation", func() {
withKubernetesVersion(kubernetesVersionUpgradeFrom),
withControlPlaneMachineCount(1),
withWorkerMachineCount(1),
withMachineDeploymentInterval(specName, ""),
withMachinePoolInterval(specName, "wait-worker-nodes"),
withControlPlaneWaiters(clusterctl.ControlPlaneWaiters{
WaitForControlPlaneInitialized: WaitForAKSControlPlaneInitialized,
WaitForControlPlaneMachinesReady: WaitForAKSControlPlaneReady,
WaitForControlPlaneInitialized: EnsureControlPlaneInitialized,
}),
withPostMachinesProvisioned(func() {
EnsureDaemonsets(ctx, func() DaemonsetsSpecInput {
return DaemonsetsSpecInput{
BootstrapClusterProxy: bootstrapClusterProxy,
Namespace: namespace,
ClusterName: clusterName,
}
})
}),
), result)

Expand Down

0 comments on commit 5d5e08b

Please sign in to comment.