Skip to content

Commit

Permalink
Remove bucket exists cache (#302)
Browse files Browse the repository at this point in the history
* Remove unused cache for bucket exists

* go mod vendor
  • Loading branch information
nolancon authored Dec 3, 2024
1 parent 39f52c7 commit 4c96fcc
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 58 deletions.
4 changes: 0 additions & 4 deletions cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import (
"github.com/linode/provider-ceph/internal/controller/s3clienthandler"

"github.com/linode/provider-ceph/internal/features"
"github.com/linode/provider-ceph/internal/rgw/cache"
)

var defaultZapConfig = map[string]string{
Expand All @@ -87,7 +86,6 @@ func main() {
backendMonitorInterval = app.Flag("backend-monitor-interval", "Interval between backend monitor controller reconciliations.").Default("60s").Duration()
pollInterval = app.Flag("poll", "How often individual resources will be checked for drift from the desired state").Short('p').Default("30m").Duration()
pollStateMetricInterval = app.Flag("poll-state-metric", "State metric recording interval").Default("5s").Duration()
bucketExistsCache = app.Flag("bucket-exists-cache", "How long the provider caches bucket exists result").Short('c').Default("5s").Duration()
reconcileConcurrency = app.Flag("reconcile-concurrency", "Set number of reconciliation loops.").Default("100").Int()
maxReconcileRate = app.Flag("max-reconcile-rate", "The global maximum rate per second at which resources may checked for drift from the desired state.").Default("1000").Int()
reconcileTimeout = app.Flag("reconcile-timeout", "Object reconciliation timeout").Short('t').Default("3s").Duration()
Expand Down Expand Up @@ -214,8 +212,6 @@ func main() {

cfg = ratelimiter.LimitRESTConfig(cfg, *kubeClientRate)

cache.BucketExistsCacheTTL = *bucketExistsCache

const oneDotTwo = 1.2
const two = 2

Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ toolchain go1.23.1

require (
github.com/alecthomas/kingpin/v2 v2.3.2
github.com/allegro/bigcache/v3 v3.1.0
github.com/aws/aws-sdk-go-v2 v1.25.2
github.com/aws/aws-sdk-go-v2/config v1.27.4
github.com/aws/aws-sdk-go-v2/credentials v1.17.4
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafo
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk=
github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I=
github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w=
github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU=
Expand Down
5 changes: 0 additions & 5 deletions internal/rgw/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/linode/provider-ceph/internal/backendstore"
"github.com/linode/provider-ceph/internal/otel/traces"
"github.com/linode/provider-ceph/internal/rgw/cache"
"go.opentelemetry.io/otel"
"golang.org/x/sync/errgroup"
)
Expand Down Expand Up @@ -40,8 +39,6 @@ func CreateBucket(ctx context.Context, s3Backend backendstore.S3Client, bucket *
return resp, errors.Wrap(err, errCreateBucket)
}

cache.Set(*bucket.Bucket)

return resp, err
}

Expand All @@ -61,8 +58,6 @@ func BucketExists(ctx context.Context, s3Backend backendstore.S3Client, bucketNa
return false, errors.Wrap(err, errHeadBucket)
}

cache.Set(bucketName)

// Bucket exists, return true with no error.
return true, nil
}
Expand Down
46 changes: 0 additions & 46 deletions internal/rgw/cache/cache.go

This file was deleted.

0 comments on commit 4c96fcc

Please sign in to comment.