Skip to content

Commit

Permalink
Fixes after upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
  • Loading branch information
saswatamcode committed Nov 18, 2024
1 parent 1cf70d5 commit 2ded621
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
10 changes: 10 additions & 0 deletions cmd/thanos/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ func (b *erroringBucket) Name() string {
return b.bkt.Name()
}

// IterWithAttributes allows to iterate over objects in the bucket with their attributes.
func (b *erroringBucket) IterWithAttributes(ctx context.Context, dir string, f func(objstore.IterObjectAttributes) error, options ...objstore.IterOption) error {
return b.bkt.IterWithAttributes(ctx, dir, f, options...)
}

// SupportedIterOptions returns the supported iteration options.
func (b *erroringBucket) SupportedIterOptions() []objstore.IterOptionType {
return b.bkt.SupportedIterOptions()
}

// Ensures that downsampleBucket() stops its work properly
// after an error occurs with some blocks in the backlog.
// Testing for https://github.com/thanos-io/thanos/issues/4960.
Expand Down
21 changes: 1 addition & 20 deletions pkg/api/query/v1.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.

// Copyright 2016 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// This package is a modified copy from
// github.com/prometheus/prometheus/web/api/v1@2121b4628baa7d9d9406aa468712a6a332e77aff.

package v1

import (
Expand Down Expand Up @@ -494,7 +475,7 @@ func processAnalysis(a *engine.AnalyzeOutputNode) queryTelemetry {
analysis.PeakSamples = a.PeakSamples()
analysis.TotalSamples = a.TotalSamples()
for _, c := range a.Children {
analysis.Children = append(analysis.Children, processAnalysis(&c))
analysis.Children = append(analysis.Children, processAnalysis(c))
}
return analysis
}
Expand Down
5 changes: 1 addition & 4 deletions pkg/block/fetcher.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.

package block

import (
Expand Down Expand Up @@ -213,7 +210,7 @@ func (f *RecursiveLister) GetActiveAndPartialBlockIDs(ctx context.Context, ch ch
case ch <- id:
}
return nil
}, objstore.WithRecursiveIter)
}, objstore.WithRecursiveIter())
return partialBlocks, err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cache/groupcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func NewGroupcacheWithConfig(logger log.Logger, reg prometheus.Registerer, conf
if err := bucket.Iter(ctx, parsedData.Name, func(s string) error {
list = append(list, s)
return nil
}, objstore.WithRecursiveIter); err != nil {
}, objstore.WithRecursiveIter()); err != nil {
return err
}

Expand Down

0 comments on commit 2ded621

Please sign in to comment.