Skip to content

Commit a933165

Browse files
code review comments addressed
1 parent b4c2013 commit a933165

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

test/e2e/common.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"encoding/json"
2222
"errors"
2323
"fmt"
24+
"maps"
2425
"path/filepath"
2526
"strconv"
2627
"strings"
@@ -597,6 +598,8 @@ func EnsureSecondaryNetworkExists(client *cloudstack.CloudStackClient, input Com
597598

598599
By("Listing network offerings")
599600
networkOffering, _, err := client.NetworkOffering.GetNetworkOfferingByName(DefaultNetworkOffering)
601+
Expect(err).To(BeNil(), "error fetching network offering %q", DefaultNetworkOffering)
602+
Expect(networkOffering).ToNot(BeNil(), "network offering %q not found", DefaultNetworkOffering)
600603

601604
// Create new network using zone and offering from primary
602605
By("Create secondary network")
@@ -650,7 +653,7 @@ func CheckIfNodesHaveTwoNICs(client *cloudstack.CloudStackClient, clusterName st
650653
}
651654
}
652655

653-
By(fmt.Sprintf("VM %q has required NICs: %v", vm.Name, keys(foundNetworks)))
656+
By(fmt.Sprintf("VM %q has required NICs: %v", vm.Name, maps.Keys(foundNetworks)))
654657
}
655658
}
656659

test/e2e/data/infrastructure-cloudstack/v1beta3/cluster-template-multiple-networks/multiple-networks.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ spec:
2828
template:
2929
name: ${CLOUDSTACK_TEMPLATE_NAME}
3030
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
31-
affinity: pro
3231
networks:
3332
- name: ${CLOUDSTACK_NETWORK_NAME}
3433
- name: ${CLOUDSTACK_NEW_NETWORK_NAME}

test/e2e/multiple_networks.go

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ import (
2121
"fmt"
2222
"os"
2323
"path/filepath"
24-
"strings"
2524

26-
"github.com/blang/semver"
2725
. "github.com/onsi/ginkgo/v2"
2826
. "github.com/onsi/gomega"
2927
corev1 "k8s.io/api/core/v1"
@@ -47,25 +45,6 @@ func MultipleNetworksSpec(ctx context.Context, inputGetter func() CommonSpecInpu
4745
Expect(ctx).NotTo(BeNil(), "ctx is required for %s spec", specName)
4846
input = inputGetter()
4947

50-
csClient := CreateCloudStackClient(ctx, input.BootstrapClusterProxy.GetKubeconfigPath())
51-
version, err := GetACSVersion(csClient)
52-
53-
if err != nil || version == "" {
54-
Skip("Failed to get CloudStack's version")
55-
}
56-
57-
v, err := semver.ParseTolerant(strings.Join(strings.Split(version, ".")[0:3], "."))
58-
59-
if err != nil {
60-
Skip("Failed to parse CloudStack version " + version)
61-
}
62-
63-
expectedRange, _ := semver.ParseRange(">=4.19.0")
64-
65-
if !expectedRange(v) {
66-
Skip("Cloudstack version " + version + " is less than 4.19.")
67-
}
68-
6948
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
7049
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
7150
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
@@ -85,7 +64,8 @@ func MultipleNetworksSpec(ctx context.Context, inputGetter func() CommonSpecInpu
8564

8665
// Get details from ACS and ensure secondary network exists
8766
csClient := CreateCloudStackClient(ctx, input.BootstrapClusterProxy.GetKubeconfigPath())
88-
EnsureSecondaryNetworkExists(csClient, input)
67+
_, err := EnsureSecondaryNetworkExists(csClient, input)
68+
Expect(err).ToNot(HaveOccurred(), "Failed to ensure secondary network exists")
8969

9070
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
9171
ClusterProxy: input.BootstrapClusterProxy,

0 commit comments

Comments
 (0)