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

Unified Diff: appengine/logdog/coordinator/coordinatorTest/service.go

Issue 1971623002: LogDog: Enable Coordinator to load project configs (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-config
Patch Set: rebase (auto) Created 4 years, 7 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 | « appengine/logdog/coordinator/coordinatorTest/context.go ('k') | appengine/logdog/coordinator/project.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/logdog/coordinator/coordinatorTest/service.go
diff --git a/appengine/logdog/coordinator/coordinatorTest/service.go b/appengine/logdog/coordinator/coordinatorTest/service.go
index 6b37dffbf9373d0d49f8b6bb9ee910ec3279c1d7..a9d39c5789d79c2c9abf8a484140f8cb58d91af4 100644
--- a/appengine/logdog/coordinator/coordinatorTest/service.go
+++ b/appengine/logdog/coordinator/coordinatorTest/service.go
@@ -7,7 +7,9 @@ package coordinatorTest
import (
"github.com/luci/luci-go/appengine/logdog/coordinator"
"github.com/luci/luci-go/appengine/logdog/coordinator/config"
+ luciConfig "github.com/luci/luci-go/common/config"
"github.com/luci/luci-go/common/gcloud/gs"
+ "github.com/luci/luci-go/common/proto/logdog/svcconfig"
"github.com/luci/luci-go/server/logdog/storage"
"golang.org/x/net/context"
)
@@ -19,6 +21,10 @@ type Services struct {
// local static members.
C func() (*config.Config, error)
+ // PC, if not nil, will be used to get the return values for ProjectConfig,
+ // overriding local static members.
+ PC func() (*svcconfig.ProjectConfig, error)
+
// Storage returns an intermediate storage instance for use by this service.
//
// The caller must close the returned instance if successful.
@@ -38,13 +44,15 @@ func (s *Services) Config(c context.Context) (*config.Config, error) {
if s.C != nil {
return s.C()
}
+ return config.Load(c)
+}
- gcfg, err := config.Load(c)
- if err != nil {
- return nil, err
+// ProjectConfig implements coordinator.Services.
+func (s *Services) ProjectConfig(c context.Context, project luciConfig.ProjectName) (*svcconfig.ProjectConfig, error) {
+ if s.PC != nil {
+ return s.PC()
}
-
- return gcfg, nil
+ return config.ProjectConfig(c, project)
}
// IntermediateStorage implements coordinator.Services.
« no previous file with comments | « appengine/logdog/coordinator/coordinatorTest/context.go ('k') | appengine/logdog/coordinator/project.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698