Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Unified Diff: dm/appengine/distributor/jobsim/run.go

Issue 2227113002: Update bulidbucket client (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/lhttp/utils.go ('k') | dm/tools/dmtool/vizQuery.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/appengine/distributor/jobsim/run.go
diff --git a/dm/appengine/distributor/jobsim/run.go b/dm/appengine/distributor/jobsim/run.go
index 3e89fd24cadd818d70281ecef64ac6ea3e6738f6..8d6072a1b09cd78599d8326a108d5f96ba9438af 100644
--- a/dm/appengine/distributor/jobsim/run.go
+++ b/dm/appengine/distributor/jobsim/run.go
@@ -9,7 +9,6 @@ import (
"fmt"
"math/rand"
"net/http"
- "strings"
"time"
"github.com/golang/protobuf/jsonpb"
@@ -17,6 +16,7 @@ import (
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/data/rand/cryptorand"
+ "github.com/luci/luci-go/common/lhttp"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/dm/api/distributor/jobsim"
dm "github.com/luci/luci-go/dm/api/service/v1"
@@ -319,19 +319,6 @@ func (r *runner) doFailure(seed int64, chance float32) (stop bool, err error) {
return
}
-func isLocalHost(host string) bool {
- switch {
- case host == "localhost", strings.HasPrefix(host, "localhost:"):
- case host == "127.0.0.1", strings.HasPrefix(host, "127.0.0.1:"):
- case host == "[::1]", strings.HasPrefix(host, "[::1]:"):
- case strings.HasPrefix(host, ":"):
-
- default:
- return false
- }
- return true
-}
-
// runJob is analogous to a single Execution of a recipe. It will:
// * Activate itself with DM.
// * Inspect its previous State to determine where it left off on the previous
@@ -353,7 +340,7 @@ func runJob(c context.Context, host string, state *state, job *jobsim.Phrase, au
Host: host,
Options: prpc.DefaultOptions(),
}
- pcli.Options.Insecure = isLocalHost(host)
+ pcli.Options.Insecure = lhttp.IsLocalHost(host)
dmc := dm.NewDepsPRPCClient(pcli)
r := runner{c, auth, dmc, state}
« no previous file with comments | « common/lhttp/utils.go ('k') | dm/tools/dmtool/vizQuery.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698