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 |