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

Unified Diff: logdog/client/cmd/logdog_butler/subcommand_run.go

Issue 2456673003: Butler: export Coordinator host in environment. (Closed)
Patch Set: Relieve suspense. Created 4 years, 2 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
Index: logdog/client/cmd/logdog_butler/subcommand_run.go
diff --git a/logdog/client/cmd/logdog_butler/subcommand_run.go b/logdog/client/cmd/logdog_butler/subcommand_run.go
index e3927b798f521e25e907aaefbc2d8334386bf380..01873c0f4c4911acfa2529c121f3247cffe1fbd6 100644
--- a/logdog/client/cmd/logdog_butler/subcommand_run.go
+++ b/logdog/client/cmd/logdog_butler/subcommand_run.go
@@ -162,12 +162,24 @@ func (cmd *runCommandRun) Run(app subcommands.Application, args []string) int {
cwd, _ = os.Getwd()
}
+ // Get our output factory.
+ of, err := a.getOutputFactory()
+ if err != nil {
+ log.WithError(err).Errorf(a, "Failed to get output factory instance.")
+ return runtimeErrorReturnCode
+ }
+
// Update our environment for the child process to inherit
bsEnv := bootstrap.Environment{
Project: a.project,
Prefix: a.prefix,
}
+ // If our output factory has a Coordinator host, fill that in too.
+ if cho, ok := of.(coordinatorHostOutput); ok {
+ bsEnv.CoordinatorHost = cho.getCoordinatorHost()
+ }
+
// Configure stream server
streamServer := streamserver.StreamServer(nil)
streamServerOwned := true
@@ -269,7 +281,7 @@ func (cmd *runCommandRun) Run(app subcommands.Application, args []string) int {
// We're about ready to execute our command. Initialize our Output instance.
// We want to do this before we execute our subprocess so that if this fails,
// we don't have to interrupt an already-running process.
- output, err := a.configOutput()
+ output, err := of.configOutput(a)
if err != nil {
log.WithError(err).Errorf(a, "Failed to create output instance.")
return runtimeErrorReturnCode
« no previous file with comments | « logdog/client/cmd/logdog_butler/output_logdog.go ('k') | logdog/client/cmd/logdog_butler/subcommand_serve.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698