From aed8c8ec1b3ba76b29ea3eac4ed9088121048592 Mon Sep 17 00:00:00 2001 From: Efim Smykov <33357780+Nutrymaco@users.noreply.github.com> Date: Fri, 9 Jun 2023 10:44:03 +0300 Subject: [PATCH] Fix typos related to Delete Item Action plugin type (#6333) Signed-off-by: Nutrymaco --- pkg/plugin/clientmgmt/manager_test.go | 16 +++++++++++++--- pkg/plugin/framework/delete_item_action.go | 4 ++-- .../framework/delete_item_action_client.go | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pkg/plugin/clientmgmt/manager_test.go b/pkg/plugin/clientmgmt/manager_test.go index 4ed74491f..1e8c14926 100644 --- a/pkg/plugin/clientmgmt/manager_test.go +++ b/pkg/plugin/clientmgmt/manager_test.go @@ -703,6 +703,16 @@ func TestGetDeleteItemActions(t *testing.T) { name: "No items", names: []string{}, }, + { + name: "Error getting restartable process", + names: []string{"velero.io/a", "velero.io/b", "velero.io/c"}, + newRestartableProcessError: errors.Errorf("NewRestartableProcess"), + expectedError: "NewRestartableProcess", + }, + { + name: "Happy path", + names: []string{"velero.io/a", "velero.io/b", "velero.io/c"}, + }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { @@ -739,9 +749,9 @@ func TestGetDeleteItemActions(t *testing.T) { restartableProcess := &restartabletest.MockRestartableProcess{} defer restartableProcess.AssertExpectations(t) - expected := &riav1cli.RestartableRestoreItemAction{ - Key: process.KindAndName{Kind: pluginKind, Name: pluginName}, - SharedPluginProcess: restartableProcess, + expected := &restartableDeleteItemAction{ + key: process.KindAndName{Kind: pluginKind, Name: pluginName}, + sharedPluginProcess: restartableProcess, } if tc.newRestartableProcessError != nil { diff --git a/pkg/plugin/framework/delete_item_action.go b/pkg/plugin/framework/delete_item_action.go index 7d70938ca..c6c0f6bbb 100644 --- a/pkg/plugin/framework/delete_item_action.go +++ b/pkg/plugin/framework/delete_item_action.go @@ -25,7 +25,7 @@ import ( proto "github.com/vmware-tanzu/velero/pkg/plugin/generated" ) -// RestoreItemActionPlugin is an implementation of go-plugin's Plugin +// DeleteItemActionPlugin is an implementation of go-plugin's Plugin // interface with support for gRPC for the restore/ItemAction // interface. type DeleteItemActionPlugin struct { @@ -33,7 +33,7 @@ type DeleteItemActionPlugin struct { *common.PluginBase } -// GRPCClient returns a RestoreItemAction gRPC client. +// GRPCClient returns a DeleteItemAction gRPC client. func (p *DeleteItemActionPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, clientConn *grpc.ClientConn) (interface{}, error) { return common.NewClientDispenser(p.ClientLogger, clientConn, newDeleteItemActionGRPCClient), nil } diff --git a/pkg/plugin/framework/delete_item_action_client.go b/pkg/plugin/framework/delete_item_action_client.go index 4988d5f08..4241d0b33 100644 --- a/pkg/plugin/framework/delete_item_action_client.go +++ b/pkg/plugin/framework/delete_item_action_client.go @@ -37,7 +37,7 @@ func NewDeleteItemActionPlugin(options ...common.PluginOption) *DeleteItemAction } } -// DeleteItemActionGRPCClient implements the backup/ItemAction interface and uses a +// DeleteItemActionGRPCClient implements the DeleteItemAction interface and uses a // gRPC client to make calls to the plugin server. type DeleteItemActionGRPCClient struct { *common.ClientBase