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

Unified Diff: logdog/appengine/coordinator/endpoints/services/getConfig.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/appengine/coordinator/endpoints/services/getConfig.go
diff --git a/logdog/appengine/coordinator/endpoints/services/getConfig.go b/logdog/appengine/coordinator/endpoints/services/getConfig.go
index 576228d15dead9870849d76c7ff495b73631ab6e..c85671e0519982af2ab942696a0587ee3f5233df 100644
--- a/logdog/appengine/coordinator/endpoints/services/getConfig.go
+++ b/logdog/appengine/coordinator/endpoints/services/getConfig.go
@@ -10,6 +10,8 @@ import (
"github.com/luci/luci-go/grpc/grpcutil"
"github.com/luci/luci-go/logdog/api/endpoints/coordinator/services/v1"
"github.com/luci/luci-go/logdog/appengine/coordinator"
+ "github.com/luci/luci-go/luci_config/appengine/gaeconfig"
+
"golang.org/x/net/context"
)
@@ -18,15 +20,24 @@ import (
func (s *server) GetConfig(c context.Context, req *google.Empty) (*logdog.GetConfigResponse, error) {
gcfg, err := coordinator.GetServices(c).Config(c)
if err != nil {
- log.Fields{
- log.ErrorKey: err,
- }.Errorf(c, "Failed to load configuration.")
+ log.WithError(err).Errorf(c, "Failed to load configuration.")
+ return nil, grpcutil.Internal
+ }
+
+ // Load our config service host from settings.
+ settings, err := gaeconfig.FetchCachedSettings(c)
+ if err != nil {
+ log.WithError(err).Errorf(c, "Failed to load settings.")
return nil, grpcutil.Internal
}
return &logdog.GetConfigResponse{
- ConfigServiceUrl: gcfg.ConfigServiceURL.String(),
+ ConfigServiceHost: settings.ConfigServiceHost,
ConfigSet: string(gcfg.ConfigSet),
ServiceConfigPath: gcfg.ServiceConfigPath,
+
+ // TODO(dnj): Deprecate this field once everything has switched over to
+ // using host.
+ ConfigServiceUrl: gcfg.ConfigServiceURL.String(),
}, nil
}

Powered by Google App Engine
This is Rietveld 408576698