Skip to content

Commit 45b73c9

Browse files
authored
Merge pull request #816 from fluxcd/badger-v4
Upgrade to Badger v4
2 parents b5a31b9 + b162d0f commit 45b73c9

File tree

9 files changed

+20
-128
lines changed

9 files changed

+20
-128
lines changed

go.mod

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ replace github.com/fluxcd/image-reflector-controller/api => ./api
77
require (
88
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6
99
github.com/Masterminds/semver/v3 v3.4.0
10-
github.com/dgraph-io/badger/v3 v3.2103.5
10+
github.com/dgraph-io/badger/v4 v4.8.0
1111
github.com/elazarl/goproxy v1.7.2
1212
github.com/fluxcd/image-reflector-controller/api v0.35.2
1313
github.com/fluxcd/pkg/apis/acl v0.9.0
@@ -62,12 +62,11 @@ require (
6262
github.com/aws/smithy-go v1.23.0 // indirect
6363
github.com/beorn7/perks v1.0.1 // indirect
6464
github.com/blang/semver/v4 v4.0.0 // indirect
65-
github.com/cespare/xxhash v1.1.0 // indirect
6665
github.com/cespare/xxhash/v2 v2.3.0 // indirect
6766
github.com/chai2010/gettext-go v1.0.3 // indirect
6867
github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
6968
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
70-
github.com/dgraph-io/ristretto v0.2.0 // indirect
69+
github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect
7170
github.com/docker/cli v28.2.2+incompatible // indirect
7271
github.com/docker/distribution v2.8.3+incompatible // indirect
7372
github.com/docker/docker-credential-helpers v0.9.3 // indirect
@@ -88,9 +87,6 @@ require (
8887
github.com/go-openapi/swag v0.23.1 // indirect
8988
github.com/gogo/protobuf v1.3.2 // indirect
9089
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
91-
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
92-
github.com/golang/protobuf v1.5.4 // indirect
93-
github.com/golang/snappy v1.0.0 // indirect
9490
github.com/google/btree v1.1.3 // indirect
9591
github.com/google/flatbuffers v25.2.10+incompatible // indirect
9692
github.com/google/gnostic-models v0.7.0 // indirect
@@ -138,7 +134,6 @@ require (
138134
github.com/vbatts/tar-split v0.12.1 // indirect
139135
github.com/x448/float16 v0.8.4 // indirect
140136
github.com/xlab/treeprint v1.2.0 // indirect
141-
go.opencensus.io v0.24.0 // indirect
142137
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
143138
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
144139
go.opentelemetry.io/otel v1.38.0 // indirect

go.sum

Lines changed: 6 additions & 113 deletions
Large diffs are not rendered by default.

internal/controller/controllers_fuzzer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535

3636
"go.uber.org/zap/zapcore"
3737

38-
"github.com/dgraph-io/badger/v3"
38+
"github.com/dgraph-io/badger/v4"
3939
. "github.com/onsi/ginkgo"
4040

4141
"k8s.io/apimachinery/pkg/types"

internal/controller/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"testing"
2525
"time"
2626

27-
"github.com/dgraph-io/badger/v3"
27+
"github.com/dgraph-io/badger/v4"
2828
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
2929
"k8s.io/client-go/kubernetes/scheme"
3030
"k8s.io/client-go/tools/record"

internal/database/badger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"fmt"
2121
"hash/adler32"
2222

23-
"github.com/dgraph-io/badger/v3"
23+
"github.com/dgraph-io/badger/v4"
2424
)
2525

2626
const tagsPrefix = "tags"

internal/database/badger_gc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"errors"
2121
"time"
2222

23-
"github.com/dgraph-io/badger/v3"
23+
"github.com/dgraph-io/badger/v4"
2424
"github.com/go-logr/logr"
2525
ctrl "sigs.k8s.io/controller-runtime"
2626
)

internal/database/badger_gc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"testing"
2222
"time"
2323

24-
"github.com/dgraph-io/badger/v3"
24+
"github.com/dgraph-io/badger/v4"
2525
"github.com/go-logr/logr"
2626
"github.com/go-logr/logr/testr"
2727
)

internal/database/badger_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"reflect"
2222
"testing"
2323

24-
"github.com/dgraph-io/badger/v3"
24+
"github.com/dgraph-io/badger/v4"
2525
)
2626

2727
const testRepo = "testing/testing"

main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"os"
2222
"time"
2323

24-
"github.com/dgraph-io/badger/v3"
24+
"github.com/dgraph-io/badger/v4"
2525
flag "github.com/spf13/pflag"
2626
corev1 "k8s.io/api/core/v1"
2727
"k8s.io/apimachinery/pkg/runtime"
@@ -233,7 +233,11 @@ func main() {
233233
}
234234

235235
if badgerGC != nil {
236-
mgr.Add(badgerGC)
236+
err := mgr.Add(badgerGC)
237+
if err != nil {
238+
setupLog.Error(err, "unable to add GC to manager")
239+
os.Exit(1)
240+
}
237241
}
238242

239243
probes.SetupChecks(mgr, setupLog)

0 commit comments

Comments
 (0)