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

Unified Diff: milo/appengine/buildbucket/buckets.go

Issue 2765383002: Milo: Move instance configuration to luci-config (Closed)
Patch Set: Review Created 3 years, 9 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 | « milo/appengine/buildbot/pubsub.go ('k') | milo/appengine/buildbucket/builder.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbucket/buckets.go
diff --git a/milo/appengine/buildbucket/buckets.go b/milo/appengine/buildbucket/buckets.go
index 1c45d4790c6c6def1038b82f288421189bc4953f..bf73cb3fd0e01533f73bd845751349288b0e084f 100644
--- a/milo/appengine/buildbucket/buckets.go
+++ b/milo/appengine/buildbucket/buckets.go
@@ -5,23 +5,34 @@
package buildbucket
import (
+ "errors"
"fmt"
"golang.org/x/net/context"
+ "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/milo/api/resp"
+ "github.com/luci/luci-go/milo/appengine/common"
)
func GetAllBuilders(c context.Context) (*resp.CIService, error) {
+ settings, err := common.GetSettings(c)
+ if err != nil {
+ logging.WithError(err).Errorf(c, "could not get settings for buildbucket")
+ return nil, err
+ }
+ bucketSettings := settings.Buildbucket
+ if bucketSettings == nil {
+ return nil, errors.New("buildbucket settings missing in config")
+ }
result := &resp.CIService{
Name: "Swarmbucket",
- // TODO(hinoka): This should be moved to luci-cfg
Host: &resp.Link{
- Label: "Prod",
- URL: "https://" + defaultServer,
+ Label: bucketSettings.Name,
+ URL: "https://" + bucketSettings.Host,
},
}
- client, err := newSwarmbucketClient(c, defaultServer)
+ client, err := newSwarmbucketClient(c, bucketSettings.Host)
if err != nil {
return nil, err
}
« no previous file with comments | « milo/appengine/buildbot/pubsub.go ('k') | milo/appengine/buildbucket/builder.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698