K8s: Dualwriter mode3: Return error from unistore (#100992)

This commit is contained in:
Stephanie Hingtgen
2025-02-19 20:40:17 +02:00
committed by GitHub
parent fd377cfe66
commit 62d502086e
2 changed files with 2 additions and 4 deletions
+1
View File
@@ -118,6 +118,7 @@ func (d *DualWriterMode3) Get(ctx context.Context, name string, options *metav1.
d.recordStorageDuration(err != nil, mode3Str, d.resource, method, startStorage)
if err != nil {
log.Error(err, "unable to get object in storage")
return nil, err
}
//nolint:errcheck
+1 -4
View File
@@ -107,10 +107,7 @@ func TestMode3_Get(t *testing.T) {
},
},
{
name: "should return an error when getting an object in the unified store fails",
setupLegacyFn: func(m *mock.Mock, name string) {
m.On("Get", mock.Anything, name, mock.Anything).Return(exampleObj, nil)
},
name: "should return an error when getting an object in the unified store fails, and should not go to legacy",
setupStorageFn: func(m *mock.Mock, name string) {
m.On("Get", mock.Anything, name, mock.Anything).Return(nil, errors.New("error"))
},