From d9387b37351013cd172ad71840ac68352a7aa800 Mon Sep 17 00:00:00 2001 From: Alison Burgess Date: Mon, 18 Mar 2024 13:20:54 -0700 Subject: [PATCH] change to r --- e2e/suite_test.go | 2 +- e2e/vmss.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/suite_test.go b/e2e/suite_test.go index b167ec68415..ef36ba006d1 100644 --- a/e2e/suite_test.go +++ b/e2e/suite_test.go @@ -113,7 +113,7 @@ func runScenario(ctx context.Context, t *testing.T, r *mrand.Rand, opts *scenari vmssSucceeded := true - vmssModel, cleanupVMSS, err := bootstrapVMSS(ctx, t, vmssName, opts, publicKeyBytes) + vmssModel, cleanupVMSS, err := bootstrapVMSS(ctx, t, r, vmssName, opts, publicKeyBytes) if !opts.suiteConfig.KeepVMSS && cleanupVMSS != nil { defer cleanupVMSS() } diff --git a/e2e/vmss.go b/e2e/vmss.go index 5d2015fc7ec..20db59d5abf 100644 --- a/e2e/vmss.go +++ b/e2e/vmss.go @@ -30,7 +30,7 @@ type VMSSOperationRetrier struct { maxRetries int } -func bootstrapVMSS(ctx context.Context, t *testing.T, vmssName string, opts *scenarioRunOpts, publicKeyBytes []byte) (*armcompute.VirtualMachineScaleSet, func(), error) { +func bootstrapVMSS(ctx context.Context, t *testing.T, r *mrand.Rand, vmssName string, opts *scenarioRunOpts, publicKeyBytes []byte) (*armcompute.VirtualMachineScaleSet, func(), error) { nodeBootstrapping, err := getNodeBootstrapping(ctx, opts.nbc) if err != nil { return nil, nil, fmt.Errorf("unable to get node bootstrapping: %w", err) @@ -49,8 +49,8 @@ func bootstrapVMSS(ctx context.Context, t *testing.T, vmssName string, opts *sce log.Printf("finished deleting vmss %q", vmssName) } - r := VMSSOperationRetrier{maxRetries: maxRetries} - vmssModel, err := r.createVMSSWithPayload(ctx, nodeBootstrapping.CustomData, nodeBootstrapping.CSE, vmssName, publicKeyBytes, opts) + rOpts := VMSSOperationRetrier{maxRetries: maxRetries} + vmssModel, err := rOpts.createVMSSWithPayload(ctx, nodeBootstrapping.CustomData, nodeBootstrapping.CSE, vmssName, publicKeyBytes, opts) if err != nil { return nil, cleanupVMSS, fmt.Errorf("unable to create VMSS with payload: %w", err) }