Storage: Add DualWriter improvements (#85968)

* Add Create tests
* Adjust mode 2 and mode 3 Get behavior

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
This commit is contained in:
Arati R
2024-04-12 14:21:10 +02:00
committed by GitHub
parent b3401c802c
commit aba15646b6
9 changed files with 57 additions and 34 deletions

View File

@@ -59,7 +59,7 @@ type spyLegacyStorageShim struct {
func (c *spyStorageClient) Create(ctx context.Context, obj runtime.Object, valitation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
c.spy.record("Storage.Create")
klog.Info("method: Storage.Create")
return nil, nil
return &dummyObject{}, nil
}
func (c *spyStorageClient) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
@@ -137,7 +137,7 @@ func (c *spyLegacyStorageClient) Counts(method string) int {
func (c *spyLegacyStorageClient) Create(ctx context.Context, obj runtime.Object, valitation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
c.spy.record("LegacyStorage.Create")
klog.Info("method: LegacyStorage.Create")
return nil, nil
return &dummyObject{}, nil
}
func (c *spyLegacyStorageClient) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {