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

Side by Side Diff: appengine/logdog/coordinator/endpoints/services/getConfig.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Code review comments, use Pub/Sub, archival staging, quality of life. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package services 5 package services
6 6
7 import ( 7 import (
8 "github.com/luci/luci-go/appengine/logdog/coordinator/config"
9 "github.com/luci/luci-go/common/api/logdog_coordinator/services/v1" 8 "github.com/luci/luci-go/common/api/logdog_coordinator/services/v1"
10 "github.com/luci/luci-go/common/grpcutil" 9 "github.com/luci/luci-go/common/grpcutil"
11 log "github.com/luci/luci-go/common/logging" 10 log "github.com/luci/luci-go/common/logging"
12 "github.com/luci/luci-go/common/proto/google" 11 "github.com/luci/luci-go/common/proto/google"
13 "golang.org/x/net/context" 12 "golang.org/x/net/context"
14 ) 13 )
15 14
16 // GetConfig allows a service to retrieve the current service configuration 15 // GetConfig allows a service to retrieve the current service configuration
17 // parameters. 16 // parameters.
18 func (*Server) GetConfig(c context.Context, req *google.Empty) (*logdog.GetConfi gResponse, error) { 17 func (s *Server) GetConfig(c context.Context, req *google.Empty) (*logdog.GetCon figResponse, error) {
19 » if err := Auth(c); err != nil { 18 » svc := s.GetServices()
19 » if err := Auth(c, svc); err != nil {
20 return nil, err 20 return nil, err
21 } 21 }
22 22
23 » cfg, err := config.LoadGlobalConfig(c) 23 » gcfg, _, err := svc.Config(c)
24 if err != nil { 24 if err != nil {
25 log.Fields{ 25 log.Fields{
26 log.ErrorKey: err, 26 log.ErrorKey: err,
27 }.Errorf(c, "Failed to load configuration.") 27 }.Errorf(c, "Failed to load configuration.")
28 return nil, grpcutil.Internal 28 return nil, grpcutil.Internal
29 } 29 }
30 30
31 return &logdog.GetConfigResponse{ 31 return &logdog.GetConfigResponse{
32 » » ConfigServiceUrl: cfg.ConfigServiceURL, 32 » » ConfigServiceUrl: gcfg.ConfigServiceURL,
33 » » ConfigSet: cfg.ConfigSet, 33 » » ConfigSet: gcfg.ConfigSet,
34 » » ConfigPath: cfg.ConfigPath, 34 » » ConfigPath: gcfg.ConfigPath,
35 }, nil 35 }, nil
36 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698