@@ -58,6 +58,7 @@ import (
5858 "sigs.k8s.io/cluster-api/util"
5959 "sigs.k8s.io/cluster-api/util/kubeconfig"
6060 crclient "sigs.k8s.io/controller-runtime/pkg/client"
61+ "github.com/gophercloud/gophercloud"
6162
6263 infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3"
6364)
@@ -1458,15 +1459,14 @@ func waitForAWSMachineRunning(namespace, name string) {
14581459func waitForClusterInfrastructureReady (namespace , name string ) bool {
14591460 fmt .Fprintf (GinkgoWriter , "Ensuring infrastructure is ready for cluster %s/%s\n " , namespace , name )
14601461 polls := 0
1461- polls0 := 0
14621462 var err error
14631463 endTime := time .Now ().Add (20 * time .Minute )
14641464 for time .Now ().Before (endTime ) {
1465- polls0 = polls + 1
1465+ polls = polls + 1
14661466 cluster := & clusterv1.Cluster {}
14671467
14681468 logit := func () {
1469- fmt .Fprintf (GinkgoWriter , "POLLING ( # %v ) (waitForClusterInfrastructureReady) --> Ensuring infrastructure is ready for cluster %s/%s : Status = %+v , Err = %v \n " , polls0 , namespace , name , cluster .Status , err )
1469+ fmt .Fprintf (GinkgoWriter , "POLLING ( # %v ) (waitForClusterInfrastructureReady) --> Ensuring infrastructure is ready for cluster %s/%s : Status = %+v , Err = %v \n " , polls , namespace , name , cluster .Status , err )
14701470 }
14711471
14721472 if err = kindClient .Get (context .TODO (), apimachinerytypes.NamespacedName {Namespace : namespace , Name : name }, cluster ); nil == err {
@@ -1475,7 +1475,7 @@ func waitForClusterInfrastructureReady(namespace, name string) bool {
14751475 return true
14761476 }
14771477 }
1478- if polls0 == 1 || polls0 % 5 == 0 {
1478+ if polls == 1 || polls % 5 == 0 {
14791479 logit ()
14801480 }
14811481 time .Sleep (15 * time .Second )
@@ -1660,6 +1660,11 @@ func makeAWSCluster(namespace, name string, multipleAZ bool) {
16601660 Spec : infrav1.AWSClusterSpec {
16611661 Region : region ,
16621662 SSHKeyName : pointer .StringPtr (keyPairName ),
1663+ NetworkSpec : infrav1.NetworkSpec {
1664+ VPC : infrav1.VPCSpec {
1665+ AvailabilityZoneUsageLimit : gophercloud .IntToPointer (1 ),
1666+ },
1667+ },
16631668 },
16641669 }
16651670 if multipleAZ {
0 commit comments