Browse Source

Ignore USE_RBE when on glinux laptops

When there's no stubby and we are asked to use google prod creds, that's invalid configuration, so don't use RBE

Bug: b/283828386
Change-Id: I1564b4f70e46fb90c87a0432c46616caa1614aac
Kousik Kumar 1 year ago
parent
commit
67ad434ffc
1 changed files with 6 additions and 0 deletions
  1. 6 0
      ui/build/config.go

+ 6 - 0
ui/build/config.go

@@ -1375,6 +1375,12 @@ func (c *configImpl) StartGoma() bool {
 }
 
 func (c *configImpl) UseRBE() bool {
+	authType, _ := c.rbeAuth()
+	// Do not use RBE with prod credentials in scenarios when stubby doesn't exist, since
+	// its unlikely that we will be able to obtain necessary creds without stubby.
+	if !c.StubbyExists() && strings.Contains(authType, "use_google_prod_creds"){
+		return false
+	}
 	if v, ok := c.Environment().Get("USE_RBE"); ok {
 		v = strings.TrimSpace(v)
 		if v != "" && v != "false" {