Skip to content

Commit

Permalink
network, e2e: Convert executeVirtctlExposeCommand() to a regular func…
Browse files Browse the repository at this point in the history
…tion

Currently, `executeVirtctlExposeCommand` 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
orelmisan committed May 17, 2023
1 parent eb47bb4 commit 9fae4a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/network/expose.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ var _ = SIGDescribe("[rfe_id:253][crit:medium][vendor:[email protected]][level:c
return tests.WaitForJobToSucceed(job, time.Duration(120)*time.Second)
}

executeVirtctlExposeCommand := func(ExposeArgs []string) error {
virtctl := clientcmd.NewRepeatableVirtctlCommand(ExposeArgs...)
return virtctl()
}

getService := func(namespace, serviceName string) (*k8sv1.Service, error) {
svc, err := virtClient.CoreV1().Services(namespace).Get(context.Background(), serviceName, k8smetav1.GetOptions{})
if err != nil {
Expand Down Expand Up @@ -777,6 +772,11 @@ func appendIpFamilyToExposeArgs(ipFamily ipFamily, vmiExposeArgs []string) []str
return vmiExposeArgs
}

func executeVirtctlExposeCommand(ExposeArgs []string) error {
virtctl := clientcmd.NewRepeatableVirtctlCommand(ExposeArgs...)
return virtctl()
}

func getNodeHostname(nodeAddresses []k8sv1.NodeAddress) *string {
for _, address := range nodeAddresses {
if address.Type == k8sv1.NodeHostName {
Expand Down

0 comments on commit 9fae4a2

Please sign in to comment.