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

Unified Diff: client/internal/logdog/butler/bundler/bundler.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/cmd/logdog_butler/subcommand_run.go ('k') | client/internal/logdog/butler/butler.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/internal/logdog/butler/bundler/bundler.go
diff --git a/client/internal/logdog/butler/bundler/bundler.go b/client/internal/logdog/butler/bundler/bundler.go
index 58ab07029d0e72a7a390293711762ab2662a1ccf..a9117fe8c7777d17f83b0c04ea80706c15f92e26 100644
--- a/client/internal/logdog/butler/bundler/bundler.go
+++ b/client/internal/logdog/butler/bundler/bundler.go
@@ -13,6 +13,7 @@ import (
"github.com/luci/luci-go/client/logdog/butlerlib/streamproto"
"github.com/luci/luci-go/common/cancelcond"
"github.com/luci/luci-go/common/clock"
+ "github.com/luci/luci-go/common/config"
"github.com/luci/luci-go/common/logdog/types"
"github.com/luci/luci-go/common/proto/google"
"github.com/luci/luci-go/common/proto/logdog/logpb"
@@ -29,6 +30,13 @@ type Config struct {
// source information to include.
Source string
+ // Project is the project to use.
+ Project config.ProjectName
+ // Prefix is the common prefix for this set of streams.
+ Prefix types.StreamName
+ // Secret is the prefix secret for this set of streams.
+ Secret []byte
+
// MaxBufferedBytes is the maximum number of bytes to buffer in memory per
// stream.
MaxBufferedBytes int64
@@ -97,6 +105,9 @@ func (b *Bundler) Register(p streamproto.Properties) (Stream, error) {
return nil, err
}
+ // Enforce that the log stream descriptor's Prefix is empty.
+ p.Prefix = ""
+
// Construct a parser for this stream.
c := streamConfig{
name: p.Name,
@@ -118,12 +129,6 @@ func (b *Bundler) Register(p streamproto.Properties) (Stream, error) {
return nil, fmt.Errorf("failed to create stream parser: %s", err)
}
- // Generate a secret for this Stream instance.
- c.template.Secret, err = types.NewPrefixSecret()
- if err != nil {
- return nil, fmt.Errorf("failed to generate stream secret: %s", err)
- }
-
b.streamsLock.Lock()
defer b.streamsLock.Unlock()
@@ -190,6 +195,9 @@ func (b *Bundler) makeBundles() {
template: logpb.ButlerLogBundle{
Source: b.c.Source,
Timestamp: google.NewTimestamp(b.getClock().Now()),
+ Project: string(b.c.Project),
+ Prefix: string(b.c.Prefix),
+ Secret: b.c.Secret,
},
}
var oldestContentTime time.Time
« no previous file with comments | « client/cmd/logdog_butler/subcommand_run.go ('k') | client/internal/logdog/butler/butler.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698