forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
network, e2e: Convert skipIfNotSupportedCluster() to a regular function
Currently, `skipIfNotSupportedCluster` is defined as an anonymous function. This function is not a closure [1], and could be defined as a regular function. [1] https://go.dev/tour/moretypes/25 Signed-off-by: Orel Misan <[email protected]>
- Loading branch information
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,18 +90,6 @@ var _ = SIGDescribe("[rfe_id:253][crit:medium][vendor:[email protected]][level:c | |
virtClient = kubevirt.Client() | ||
}) | ||
|
||
skipIfNotSupportedCluster := func(ipFamily ipFamily) { | ||
if includesIpv4(ipFamily) { | ||
libnet.SkipWhenClusterNotSupportIpv4() | ||
} | ||
if inlcudesIpv6(ipFamily) { | ||
libnet.SkipWhenClusterNotSupportIpv6() | ||
} | ||
if isDualStack(ipFamily) { | ||
checks.SkipIfVersionBelow("Dual stack service requires v1.20 and above", "1.20") | ||
} | ||
} | ||
|
||
appendIpFamilyToExposeArgs := func(ipFamily ipFamily, vmiExposeArgs []string) []string { | ||
if inlcudesIpv6(ipFamily) { | ||
vmiExposeArgs = append(vmiExposeArgs, "--ip-family", string(ipFamily)) | ||
|
@@ -777,6 +765,18 @@ func validateClusterIp(clusterIp string, ipFamily ipFamily) error { | |
return nil | ||
} | ||
|
||
func skipIfNotSupportedCluster(ipFamily ipFamily) { | ||
if includesIpv4(ipFamily) { | ||
libnet.SkipWhenClusterNotSupportIpv4() | ||
} | ||
if inlcudesIpv6(ipFamily) { | ||
libnet.SkipWhenClusterNotSupportIpv6() | ||
} | ||
if isDualStack(ipFamily) { | ||
checks.SkipIfVersionBelow("Dual stack service requires v1.20 and above", "1.20") | ||
} | ||
} | ||
|
||
func getNodeHostname(nodeAddresses []k8sv1.NodeAddress) *string { | ||
for _, address := range nodeAddresses { | ||
if address.Type == k8sv1.NodeHostName { | ||
|