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

Unified Diff: go/src/infra/tools/kitchen/cook.go

Issue 2146403002: Kitchen: Generate LogDog prefix from Swarming. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix error strings in tests. Created 4 years, 5 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 | « DEPS ('k') | go/src/infra/tools/kitchen/cook_logdog.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/tools/kitchen/cook.go
diff --git a/go/src/infra/tools/kitchen/cook.go b/go/src/infra/tools/kitchen/cook.go
index 871ef22533f60505b60466a4ec839ae150d28f13..ba1253996e1d615cd24e6b953ca459fac8c1628a 100644
--- a/go/src/infra/tools/kitchen/cook.go
+++ b/go/src/infra/tools/kitchen/cook.go
@@ -23,7 +23,6 @@ import (
"github.com/luci/luci-go/common/ctxcmd"
"github.com/luci/luci-go/common/environ"
"github.com/luci/luci-go/common/flag/stringlistflag"
- ldTypes "github.com/luci/luci-go/common/logdog/types"
)
// BootstrapStepName is the name of kitchen's step where it makes preparations
@@ -72,31 +71,8 @@ var cmdCook = &subcommands.Command{
false,
"If true, print CURRENT_TIMESTAMP annotations.")
- fs.StringVar(
- &c.logdog.host,
- "logdog-host",
- "",
- "The name of the LogDog host.")
- fs.StringVar(
- &c.logdog.project,
- "logdog-project",
- "",
- "The name of the LogDog project to log into. Projects have different ACL sets, "+
- "so choose this appropriately.")
- fs.Var(
- &c.logdog.prefix,
- "logdog-prefix",
- "The LogDog stream Prefix to use.")
- fs.BoolVar(
- &c.logdog.annotee,
- "logdog-enable-annotee",
- true,
- "Process bootstrap STDOUT/STDERR annotations through Annotee.")
- fs.StringVar(
- &c.logdog.filePath,
- "logdog-debug-out-file",
- "",
- "If specified, write all generated logs to this path instead of sending them.")
+ c.logdog.addFlags(fs)
+
return &c
},
}
@@ -118,18 +94,6 @@ type cookRun struct {
logdog cookLogDogParams
}
-type cookLogDogParams struct {
- host string
- project string
- prefix ldTypes.StreamName
- annotee bool
- filePath string
-}
-
-func (p *cookLogDogParams) active() bool {
- return p.host != "" || p.project != "" || p.prefix != ""
-}
-
func (c *cookRun) validateFlags() error {
// Validate Repository.
if c.RepositoryURL == "" {
@@ -155,8 +119,8 @@ func (c *cookRun) validateFlags() error {
// If LogDog is enabled, all required LogDog flags must be supplied.
if c.logdog.active() {
- if c.logdog.project == "" {
- return fmt.Errorf("a LogDog project must be supplied (-logdog-project)")
+ if err := c.logdog.validate(); err != nil {
+ return err
}
}
« no previous file with comments | « DEPS ('k') | go/src/infra/tools/kitchen/cook_logdog.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698