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 <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/buildlet/ec2.go b/buildlet/ec2.go
index 4a52b20..bb430b5 100644
--- a/buildlet/ec2.go
+++ b/buildlet/ec2.go
@@ -71,7 +71,7 @@
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 @@
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 8fe1ae6..91137ea 100644
--- a/buildlet/ec2_test.go
+++ b/buildlet/ec2_test.go
@@ -190,7 +190,7 @@
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)
}