@@ -764,7 +764,7 @@ var _ = Describe("e2e tests [PR-Blocking]", func() {
764764 openStackCluster , err := shared .ClusterForSpec (ctx , e2eCtx , namespace )
765765 Expect (err ).NotTo (HaveOccurred ())
766766
767- var allMachines []clusterv1.Machine
767+ allMachines := make ( []clusterv1.Machine , 0 , len ( controlPlaneMachines ) + len ( workerMachines ))
768768 allMachines = append (allMachines , controlPlaneMachines ... )
769769 allMachines = append (allMachines , workerMachines ... )
770770
@@ -787,7 +787,7 @@ var _ = Describe("e2e tests [PR-Blocking]", func() {
787787 Expect (err ).NotTo (HaveOccurred ())
788788 Expect (ports ).To (HaveLen (len (expectedPorts )))
789789
790- var seenNetworks []string
790+ seenNetworks := make ( []string , 0 , len ( ports ))
791791 var seenAddresses clusterv1.MachineAddresses
792792 for j := range ports {
793793 port := & ports [j ]
@@ -938,7 +938,7 @@ var _ = Describe("e2e tests [PR-Blocking]", func() {
938938 fmt .Sprintf ("Cluster %s: worker machines were not scheduled in the expected AZ" , cluster .Name ))
939939
940940 // Check that all machines were actually scheduled in the correct AZ
941- var allMachines []clusterv1.Machine
941+ allMachines := make ( []clusterv1.Machine , 0 , len ( controlPlaneMachines ) + len ( workerMachines ))
942942 allMachines = append (allMachines , controlPlaneMachines ... )
943943 allMachines = append (allMachines , workerMachines ... )
944944
0 commit comments