Fix typos related to Delete Item Action plugin type (#6333)

Signed-off-by: Nutrymaco <efim7299@icloud.com>
This commit is contained in:
Efim Smykov
2023-06-09 10:44:03 +03:00
committed by GitHub
parent d90ca5928c
commit aed8c8ec1b
3 changed files with 16 additions and 6 deletions

View File

@@ -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 {

View File

@@ -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
}

View File

@@ -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