Skip to content

Commit bf3ca7a

Browse files
committed
sysd: fix key not cloned for sub buckets
1 parent a5edfc4 commit bf3ca7a

2 files changed

Lines changed: 3 additions & 22 deletions

File tree

pkg/platform/log/logs_syslog_file.go

Lines changed: 0 additions & 18 deletions
This file was deleted.

pkg/storage/state/scoped.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package state
22

33
import (
4-
"errors"
4+
"fmt"
55

66
"go.etcd.io/bbolt"
77
)
@@ -33,7 +33,7 @@ func (sst *ScopedState) ensureBucket(tx *bbolt.Tx, write bool) (*bbolt.Bucket, e
3333
return nil, err
3434
}
3535
if bb == nil {
36-
return nil, errors.New("bucket does not exist")
36+
return nil, fmt.Errorf("bucket '%s' does not exist in path '%s'", part, sst.bucketPath.String())
3737
}
3838
b = bb
3939
}
@@ -61,9 +61,8 @@ func (sst *ScopedState) View(fn func(*bbolt.Tx, *bbolt.Bucket) error) error {
6161
}
6262

6363
func (sst *ScopedState) ForBucket(path ...string) *ScopedState {
64-
path = append([]string{RootBucket}, path...)
6564
return &ScopedState{
6665
root: sst.root,
67-
bucketPath: sst.bucketPath.Add(path...),
66+
bucketPath: sst.bucketPath.Copy().Add(path...),
6867
}
6968
}

0 commit comments

Comments
 (0)