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

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

Issue 2715443002: Butler: Infer host from "coordinator-host" flag. (Closed)
Patch Set: module => service Created 3 years, 10 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 | « logdog/client/cmd/logdog_butler/main.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/client/cmd/logdog_butler/output_logdog.go
diff --git a/logdog/client/cmd/logdog_butler/output_logdog.go b/logdog/client/cmd/logdog_butler/output_logdog.go
index 718a1917726e687d2b833ef238e2044a705108df..2e567fb03c4b819e7bb47197a21fc7a91f5acff9 100644
--- a/logdog/client/cmd/logdog_butler/output_logdog.go
+++ b/logdog/client/cmd/logdog_butler/output_logdog.go
@@ -5,6 +5,7 @@
package main
import (
+ "fmt"
"time"
"github.com/luci/luci-go/common/clock/clockflag"
@@ -20,7 +21,7 @@ func init() {
// logdogOutputFactory for publishing logs using a LogDog Coordinator host.
type logdogOutputFactory struct {
- host string
+ service string
prefixExpiration clockflag.Duration
track bool
@@ -32,8 +33,8 @@ func (f *logdogOutputFactory) option() multiflag.Option {
opt := newOutputOption("logdog", "Output to a LogDog Coordinator instance.", f)
flags := opt.Flags()
- flags.StringVar(&f.host, "host", "",
- "The LogDog Coordinator host name.")
+ flags.StringVar(&f.service, "service", "",
+ "Optional service within <host> to use. Will be referenced as <service>-dot-<host>.")
flags.Var(&f.prefixExpiration, "prefix-expiration",
"Amount of time after registration that the prefix will be active. If omitted, the service "+
"default will be used. This should exceed the expected lifetime of the job by a fair margin.")
@@ -51,9 +52,17 @@ func (f *logdogOutputFactory) configOutput(a *application) (output.Output, error
return nil, errors.Annotate(err).Reason("failed to instantiate authenticator").Err()
}
+ host := a.coordinatorHost
+ if host == "" {
+ return nil, errors.New("logdog output requires a Coordinator host (-coordinator-host)")
+ }
+ if f.service != "" {
+ host = fmt.Sprintf("%s-dot-%s", f.service, host)
+ }
+
cfg := out.Config{
Auth: auth,
- Host: f.host,
+ Host: host,
Project: a.project,
Prefix: a.prefix,
PrefixExpiration: time.Duration(f.prefixExpiration),
« no previous file with comments | « logdog/client/cmd/logdog_butler/main.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698