From f1f00556638d6d62420924d0a2941a06bfa0f516 Mon Sep 17 00:00:00 2001 From: Hugo <10965479+hugoghx@users.noreply.github.com> Date: Wed, 28 Feb 2024 18:40:06 +0000 Subject: [PATCH] feat(plugin): Implement OnDeleteStorageBucket --- plugin/service/storage/plugin.go | 3 ++- plugin/service/storage/plugin_test.go | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/service/storage/plugin.go b/plugin/service/storage/plugin.go index 54e3fcd..333d0b6 100644 --- a/plugin/service/storage/plugin.go +++ b/plugin/service/storage/plugin.go @@ -82,8 +82,9 @@ func (sp *StoragePlugin) OnUpdateStorageBucket(ctx context.Context, req *pb.OnUp } // OnDeleteStorageBucket is a hook that runs when a storage bucket is deleted. +// Since this plugin manages no state at the moment, this function is a no-op. func (sp *StoragePlugin) OnDeleteStorageBucket(ctx context.Context, req *pb.OnDeleteStorageBucketRequest) (*pb.OnDeleteStorageBucketResponse, error) { - return nil, fmt.Errorf("unimplemented") + return &pb.OnDeleteStorageBucketResponse{}, nil } // ValidatePermissions is a hook that checks if the secrets associated with the diff --git a/plugin/service/storage/plugin_test.go b/plugin/service/storage/plugin_test.go index 701ff9f..5107513 100644 --- a/plugin/service/storage/plugin_test.go +++ b/plugin/service/storage/plugin_test.go @@ -264,7 +264,12 @@ func TestOnCreateStorageBucket(t *testing.T) { func TestOnUpdateStorageBucket(t *testing.T) {} -func TestOnDeleteStorageBucket(t *testing.T) {} +func TestOnDeleteStorageBucket(t *testing.T) { + sp := new(StoragePlugin) + rsp, err := sp.OnDeleteStorageBucket(context.Background(), &plugin.OnDeleteStorageBucketRequest{}) + require.NoError(t, err) + require.NotNil(t, rsp) +} func TestValidatePermissions(t *testing.T) { ctx := context.Background()