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

Unified Diff: client/logdog/butlerlib/bootstrap/bootstrap.go

Issue 1906023002: LogDog: Add project namespace to Butler/Collector. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-archivist
Patch Set: Rebase? Created 4 years, 8 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 | « client/internal/logdog/butler/butler_test.go ('k') | client/logdog/butlerlib/bootstrap/bootstrap_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/logdog/butlerlib/bootstrap/bootstrap.go
diff --git a/client/logdog/butlerlib/bootstrap/bootstrap.go b/client/logdog/butlerlib/bootstrap/bootstrap.go
index 9004bd6d9e26c9955162ad7c69b6790583581bfc..ed8a77706cb0f9e2747acd8d9f3f7d13e26a709c 100644
--- a/client/logdog/butlerlib/bootstrap/bootstrap.go
+++ b/client/logdog/butlerlib/bootstrap/bootstrap.go
@@ -10,6 +10,7 @@ import (
"github.com/luci/luci-go/client/environ"
"github.com/luci/luci-go/client/logdog/butlerlib/streamclient"
+ "github.com/luci/luci-go/common/config"
"github.com/luci/luci-go/common/logdog/types"
)
@@ -19,6 +20,8 @@ var ErrNotBootstrapped = errors.New("not bootstrapped")
// Bootstrap contains information about the
type Bootstrap struct {
+ // Project is the Butler instance project name.
+ Project config.ProjectName
// Prefix is the Butler instance prefix.
Prefix types.StreamName
@@ -35,10 +38,14 @@ func getFromEnv(env environ.Environment, reg *streamclient.Registry) (*Bootstrap
}
bs := &Bootstrap{
- Prefix: types.StreamName(prefix),
+ Prefix: types.StreamName(prefix),
+ Project: config.ProjectName(env[EnvStreamProject]),
}
if err := bs.Prefix.Validate(); err != nil {
- return nil, fmt.Errorf("bootstrap: failed to validate prefix [%s]: %s", prefix, err)
+ return nil, fmt.Errorf("bootstrap: failed to validate prefix %q: %s", prefix, err)
+ }
+ if err := bs.Project.Validate(); err != nil {
+ return nil, fmt.Errorf("bootstrap: failed to validate project %q: %s", bs.Project, err)
}
// If we have a stream server attached; instantiate a stream Client.
« no previous file with comments | « client/internal/logdog/butler/butler_test.go ('k') | client/logdog/butlerlib/bootstrap/bootstrap_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698