Skip to content

Commit

Permalink
cmd/gomote: disable adding the bootstrap version of Go for non LUCI
Browse files Browse the repository at this point in the history
Gomote instances that are created on the LUCI infrastructure already
contain the bootstrap version of Go installed. This change removes the
call to add the bootstrap version of Go on instances which are
running on LUCI.

Fixes golang/go#66619
For golang/go#66635

Change-Id: Ib210c527a09d0bff802e5958f1b78d70e1370e68
Reviewed-on: https://go-review.googlesource.com/c/build/+/574720
Reviewed-by: Than McIntosh <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Carlos Amedee <[email protected]>
  • Loading branch information
cagedmantis authored and gopherbot committed Apr 1, 2024
1 parent f6df090 commit 4d6b59e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
21 changes: 12 additions & 9 deletions cmd/gomote/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,18 @@ func doPush(ctx context.Context, name, goroot string, dryRun, detailedProgress b
remote[en[len("go/"):]] = de
}
}
logf("installing go-bootstrap version in the working directory")
if dryRun {
logf("(Dry-run) Would have pushed go-bootstrap")
} else {
_, err := client.AddBootstrap(ctx, &protos.AddBootstrapRequest{
GomoteId: name,
})
if err != nil {
return fmt.Errorf("unable to add bootstrap version of Go to instance: %w", err)
// TODO(66635) remove once gomotes can no longer be created via the coordinator.
if luciDisabled() {
logf("installing go-bootstrap version in the working directory")
if dryRun {
logf("(Dry-run) Would have pushed go-bootstrap")
} else {
_, err := client.AddBootstrap(ctx, &protos.AddBootstrapRequest{
GomoteId: name,
})
if err != nil {
return fmt.Errorf("unable to add bootstrap version of Go to instance: %w", err)
}
}
}

Expand Down
21 changes: 12 additions & 9 deletions cmd/gomote/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,18 @@ func putBootstrap(args []string) error {
for _, inst := range putSet {
inst := inst
eg.Go(func() error {
client := gomoteServerClient(ctx)
resp, err := client.AddBootstrap(ctx, &protos.AddBootstrapRequest{
GomoteId: inst,
})
if err != nil {
return fmt.Errorf("unable to add bootstrap version of Go to instance: %w", err)
}
if resp.GetBootstrapGoUrl() == "" {
fmt.Printf("No GoBootstrapURL defined for %q; ignoring. (may be baked into image)\n", inst)
// TODO(66635) remove once gomotes can no longer be created via the coordinator.
if luciDisabled() {
client := gomoteServerClient(ctx)
resp, err := client.AddBootstrap(ctx, &protos.AddBootstrapRequest{
GomoteId: inst,
})
if err != nil {
return fmt.Errorf("unable to add bootstrap version of Go to instance: %w", err)
}
if resp.GetBootstrapGoUrl() == "" {
fmt.Printf("No GoBootstrapURL defined for %q; ignoring. (may be baked into image)\n", inst)
}
}
return nil
})
Expand Down

0 comments on commit 4d6b59e

Please sign in to comment.