MCPcopy Create free account
hub / github.com/cortexproject/cortex / Upload

Method Upload

pkg/util/testutil/objstore.go:81–93  ·  view source on GitHub ↗
(ctx context.Context, name string, r io.Reader, opts ...objstore.ObjectUploadOption)

Source from the content-addressed store, hash-verified

79}
80
81func (m *MockBucketFailure) Upload(ctx context.Context, name string, r io.Reader, opts ...objstore.ObjectUploadOption) error {
82 m.UploadCalls.Add(1)
83 for prefix, err := range m.UploadFailures {
84 if strings.HasPrefix(name, prefix) {
85 return err
86 }
87 }
88 if e, ok := m.GetFailures[name]; ok {
89 return e
90 }
91
92 return m.Bucket.Upload(ctx, name, r, opts...)
93}
94
95func (m *MockBucketFailure) WithExpectedErrs(expectedFunc objstore.IsOpFailureExpectedFunc) objstore.Bucket {
96 if ibkt, ok := m.Bucket.(objstore.InstrumentedBucket); ok {

Callers 7

WriteUserIndexFunction · 0.45
writeFunction · 0.45
MockStorageBlockFunction · 0.45
MockStorageDeletionMarkFunction · 0.45

Calls 1

AddMethod · 0.45

Tested by 1