K8s: Dualwriter mode3: Return error from unistore (#100992)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"))
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user