Skip to content

Commit

Permalink
cmd/coordinator,internal/gomote: fix release prioritization
Browse files Browse the repository at this point in the history
Updates the username matching in the coordinator to determine if a
buildlet is for a release.

Updates golang/go#48857

Change-Id: I0d7197ac2955baab2d8b3eb37bb265cf77a43876
Reviewed-on: https://go-review.googlesource.com/c/build/+/422596
Auto-Submit: Jenny Rakoczy <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Heschi Kreinick <[email protected]>
Run-TryBot: Jenny Rakoczy <[email protected]>
  • Loading branch information
toothrot authored and gopherbot committed Aug 10, 2022
1 parent e88786c commit 27753f8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions internal/gomote/gomote.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,15 @@ func (s *Server) CreateInstance(req *protos.CreateInstanceRequest, stream protos
if bconf.IsRestricted() && !isPrivilegedUser(creds.Email) {
return status.Errorf(codes.PermissionDenied, "user is unable to create gomote of that builder type")
}
userName, err := emailToUser(creds.Email)
if err != nil {
return status.Errorf(codes.Internal, "invalid user email format")
}
si := &queue.SchedItem{
HostType: bconf.HostType,
IsGomote: true,
User: creds.Email,
HostType: bconf.HostType,
IsGomote: true,
IsRelease: userName == "relui-prod",
User: creds.Email,
}
type result struct {
buildletClient buildlet.Client
Expand Down Expand Up @@ -166,10 +171,6 @@ func (s *Server) CreateInstance(req *protos.CreateInstanceRequest, stream protos

return status.Errorf(codes.Unknown, "gomote creation failed: %s", err)
}
userName, err := emailToUser(creds.Email)
if err != nil {
return status.Errorf(codes.Internal, "invalid user email format")
}
gomoteID := s.buildlets.AddSession(creds.ID, userName, req.GetBuilderType(), bconf.HostType, r.buildletClient)
log.Printf("created buildlet %v for %v (%s)", gomoteID, userName, r.buildletClient.String())
session, err := s.buildlets.Session(gomoteID)
Expand Down

0 comments on commit 27753f8

Please sign in to comment.