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

Unified Diff: logdog/server/service/config/flag.go

Issue 2643803003: config: Update remote URL handling. (Closed)
Patch Set: Fix "nost" Created 3 years, 11 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
Index: logdog/server/service/config/flag.go
diff --git a/logdog/server/service/config/flag.go b/logdog/server/service/config/flag.go
index 47ba374bd51e28f95fae70ccd6702b8e25dbc4e9..03f7660ae8d95a4a9690dff741b6f918ae7e0ba2 100644
--- a/logdog/server/service/config/flag.go
+++ b/logdog/server/service/config/flag.go
@@ -7,7 +7,9 @@ package config
import (
"errors"
"flag"
+ "fmt"
"net/http"
+ "net/url"
"time"
"github.com/luci/luci-go/common/clock/clockflag"
@@ -62,8 +64,16 @@ func (f *Flags) CoordinatorOptions(c context.Context, client logdog.ServicesClie
return nil, err
}
} else {
- if ccfg.ConfigServiceUrl == "" {
- return nil, errors.New("coordinator does not specify a config service")
+ host := ccfg.ConfigServiceHost
+ if host == "" {
+ if ccfg.ConfigServiceUrl == "" {
+ return nil, errors.New("coordinator does not specify a config service")
+ }
+ u, err := url.Parse(ccfg.ConfigServiceUrl)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse config service URL: %v", err)
+ }
+ host = u.Host
}
if ccfg.ConfigSet == "" {
return nil, errors.New("coordinator does not specify a config set")
@@ -79,7 +89,7 @@ func (f *Flags) CoordinatorOptions(c context.Context, client logdog.ServicesClie
return &http.Client{Transport: rr}, nil
}
}
- ci = remote.New(ccfg.ConfigServiceUrl, clientFactory)
+ ci = remote.New(host, false, clientFactory)
}
return &Options{
« no previous file with comments | « logdog/appengine/coordinator/endpoints/services/getConfig_test.go ('k') | logdog/server/service/config/flag_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698