Skip to content

Commit

Permalink
buildlet: unexport WaitUntilVMExists method
Browse files Browse the repository at this point in the history
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 <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
  • Loading branch information
cagedmantis committed Aug 7, 2020
1 parent 22f2f08 commit 5a0d462
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions buildlet/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion buildlet/ec2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 5a0d462

Please sign in to comment.