| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package services | 5 package services |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 log "github.com/luci/luci-go/common/logging" | 8 log "github.com/luci/luci-go/common/logging" |
| 9 "github.com/luci/luci-go/common/proto/google" | 9 "github.com/luci/luci-go/common/proto/google" |
| 10 "github.com/luci/luci-go/grpc/grpcutil" | 10 "github.com/luci/luci-go/grpc/grpcutil" |
| 11 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/services/v1" | 11 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/services/v1" |
| 12 "github.com/luci/luci-go/logdog/appengine/coordinator" | 12 "github.com/luci/luci-go/logdog/appengine/coordinator" |
| 13 "golang.org/x/net/context" | 13 "golang.org/x/net/context" |
| 14 ) | 14 ) |
| 15 | 15 |
| 16 // GetConfig allows a service to retrieve the current service configuration | 16 // GetConfig allows a service to retrieve the current service configuration |
| 17 // parameters. | 17 // parameters. |
| 18 func (s *server) GetConfig(c context.Context, req *google.Empty) (*logdog.GetCon
figResponse, error) { | 18 func (s *server) GetConfig(c context.Context, req *google.Empty) (*logdog.GetCon
figResponse, error) { |
| 19 gcfg, err := coordinator.GetServices(c).Config(c) | 19 gcfg, err := coordinator.GetServices(c).Config(c) |
| 20 if err != nil { | 20 if err != nil { |
| 21 log.Fields{ | 21 log.Fields{ |
| 22 log.ErrorKey: err, | 22 log.ErrorKey: err, |
| 23 }.Errorf(c, "Failed to load configuration.") | 23 }.Errorf(c, "Failed to load configuration.") |
| 24 return nil, grpcutil.Internal | 24 return nil, grpcutil.Internal |
| 25 } | 25 } |
| 26 | 26 |
| 27 return &logdog.GetConfigResponse{ | 27 return &logdog.GetConfigResponse{ |
| 28 ConfigServiceUrl: gcfg.ConfigServiceURL.String(), | 28 ConfigServiceUrl: gcfg.ConfigServiceURL.String(), |
| 29 » » ConfigSet: gcfg.ConfigSet, | 29 » » ConfigSet: string(gcfg.ConfigSet), |
| 30 ServiceConfigPath: gcfg.ServiceConfigPath, | 30 ServiceConfigPath: gcfg.ServiceConfigPath, |
| 31 }, nil | 31 }, nil |
| 32 } | 32 } |
| OLD | NEW |