From 5a0d462c321e947657e709325e870bebfff3bd1a Mon Sep 17 00:00:00 2001 From: Carlos Amedee Date: Fri, 7 Aug 2020 12:22:05 -0400 Subject: [PATCH] buildlet: unexport WaitUntilVMExists method This change modifies the WaitUntilVMExists method and sets it to not be exported. It will never be directly called by anything outside of the EC2Client. Updates golang/go#36841 Change-Id: If6dfea8c4c191036c8fadd9ad8767e85e55cd224 Reviewed-on: https://go-review.googlesource.com/c/build/+/247400 Run-TryBot: Carlos Amedee TryBot-Result: Gobot Gobot Reviewed-by: Alexander Rakoczy --- buildlet/ec2.go | 6 +++--- buildlet/ec2_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildlet/ec2.go b/buildlet/ec2.go index 4a52b20855..bb430b5567 100644 --- a/buildlet/ec2.go +++ b/buildlet/ec2.go @@ -71,7 +71,7 @@ func (c *EC2Client) StartNewVM(ctx context.Context, buildEnv *buildenv.Environme if err != nil { return nil, err } - if err = c.WaitUntilVMExists(ctx, vm.ID, opts); err != nil { + if err = c.waitUntilVMExists(ctx, vm.ID, opts); err != nil { return nil, err } // once the VM is up and running then all of the configuration data is available @@ -100,8 +100,8 @@ func (c *EC2Client) createVM(ctx context.Context, config *cloud.EC2VMConfigurati return inst, nil } -// WaitUntilVMExists submits a request which waits until an instance exists before returning. -func (c *EC2Client) WaitUntilVMExists(ctx context.Context, instID string, opts *VMOpts) error { +// waitUntilVMExists submits a request which waits until an instance exists before returning. +func (c *EC2Client) waitUntilVMExists(ctx context.Context, instID string, opts *VMOpts) error { if err := c.client.WaitUntilInstanceRunning(ctx, instID); err != nil { return fmt.Errorf("failed waiting for vm instance: %w", err) } diff --git a/buildlet/ec2_test.go b/buildlet/ec2_test.go index 8fe1ae684c..91137ea9f4 100644 --- a/buildlet/ec2_test.go +++ b/buildlet/ec2_test.go @@ -190,7 +190,7 @@ func TestWaitUntilInstanceExists(t *testing.T) { if gotErr != nil { t.Fatalf("createVM(ctx, %v, %v) failed with %s", vmConfig, opts, gotErr) } - gotErr = c.WaitUntilVMExists(ctx, gotVM.ID, opts) + gotErr = c.waitUntilVMExists(ctx, gotVM.ID, opts) if gotErr != nil { t.Fatalf("WaitUntilVMExists(%v, %v, %v) failed with error %s", ctx, gotVM.ID, opts, gotErr) }