Skip to content

Commit 27753f8

Browse files
toothrotgopherbot
authored andcommitted
cmd/coordinator,internal/gomote: fix release prioritization
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]>
1 parent e88786c commit 27753f8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

internal/gomote/gomote.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,15 @@ func (s *Server) CreateInstance(req *protos.CreateInstanceRequest, stream protos
131131
if bconf.IsRestricted() && !isPrivilegedUser(creds.Email) {
132132
return status.Errorf(codes.PermissionDenied, "user is unable to create gomote of that builder type")
133133
}
134+
userName, err := emailToUser(creds.Email)
135+
if err != nil {
136+
return status.Errorf(codes.Internal, "invalid user email format")
137+
}
134138
si := &queue.SchedItem{
135-
HostType: bconf.HostType,
136-
IsGomote: true,
137-
User: creds.Email,
139+
HostType: bconf.HostType,
140+
IsGomote: true,
141+
IsRelease: userName == "relui-prod",
142+
User: creds.Email,
138143
}
139144
type result struct {
140145
buildletClient buildlet.Client
@@ -166,10 +171,6 @@ func (s *Server) CreateInstance(req *protos.CreateInstanceRequest, stream protos
166171

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

0 commit comments

Comments
 (0)