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

Side by Side Diff: logdog/client/butler/bootstrap/env.go

Issue 2456673003: Butler: export Coordinator host in environment. (Closed)
Patch Set: Relieve suspense. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | logdog/client/butlerlib/bootstrap/bootstrap.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 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 bootstrap handles Butler-side bootstrapping functionality. 5 // Package bootstrap handles Butler-side bootstrapping functionality.
6 package bootstrap 6 package bootstrap
7 7
8 import ( 8 import (
9 "github.com/luci/luci-go/common/config" 9 "github.com/luci/luci-go/common/config"
10 "github.com/luci/luci-go/common/system/environ" 10 "github.com/luci/luci-go/common/system/environ"
11 "github.com/luci/luci-go/logdog/client/butlerlib/bootstrap" 11 "github.com/luci/luci-go/logdog/client/butlerlib/bootstrap"
12 "github.com/luci/luci-go/logdog/common/types" 12 "github.com/luci/luci-go/logdog/common/types"
13 ) 13 )
14 14
15 // Environment is the set of configuration parameters for the bootstrap. 15 // Environment is the set of configuration parameters for the bootstrap.
16 type Environment struct { 16 type Environment struct {
17 // CoordinatorHost is the coordinator host name, or empty string if we a re
18 // not outputting to a Coordinator.
19 CoordinatorHost string
20
17 // Project is the project name. If not empty, this will be exported to 21 // Project is the project name. If not empty, this will be exported to
18 // subprocesses. 22 // subprocesses.
19 Project config.ProjectName 23 Project config.ProjectName
20 // Prefix is the prefix name. If not empty, this will be exported to 24 // Prefix is the prefix name. If not empty, this will be exported to
21 // subprocesses. 25 // subprocesses.
22 Prefix types.StreamName 26 Prefix types.StreamName
23 // StreamServerURI is the streamserver URI. If not empty, this will be 27 // StreamServerURI is the streamserver URI. If not empty, this will be
24 // exported to subprocesses. 28 // exported to subprocesses.
25 StreamServerURI string 29 StreamServerURI string
26 } 30 }
27 31
28 // Augment augments the supplied base environment with LogDog Butler bootstrap 32 // Augment augments the supplied base environment with LogDog Butler bootstrap
29 // parameters. 33 // parameters.
30 func (e *Environment) Augment(base environ.Env) { 34 func (e *Environment) Augment(base environ.Env) {
31 exportIf := func(envKey, v string) { 35 exportIf := func(envKey, v string) {
32 if v != "" { 36 if v != "" {
33 base.Set(envKey, v) 37 base.Set(envKey, v)
34 } 38 }
35 } 39 }
36 40
41 exportIf(bootstrap.EnvCoordinatorHost, e.CoordinatorHost)
37 exportIf(bootstrap.EnvStreamPrefix, string(e.Prefix)) 42 exportIf(bootstrap.EnvStreamPrefix, string(e.Prefix))
38 exportIf(bootstrap.EnvStreamProject, string(e.Project)) 43 exportIf(bootstrap.EnvStreamProject, string(e.Project))
39 exportIf(bootstrap.EnvStreamServerPath, e.StreamServerURI) 44 exportIf(bootstrap.EnvStreamServerPath, e.StreamServerURI)
40 } 45 }
OLDNEW
« no previous file with comments | « no previous file | logdog/client/butlerlib/bootstrap/bootstrap.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698