mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-18 22:14:29 +00:00
chore: enable use-any from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -39,7 +39,7 @@ const defaultTimeout = 30 * time.Second
|
||||
type PodCommandExecutor interface {
|
||||
// ExecutePodCommand executes a command in a container in a pod. If the command takes longer than
|
||||
// the specified timeout, an error is returned.
|
||||
ExecutePodCommand(log logrus.FieldLogger, item map[string]interface{}, namespace, name, hookName string, hook *api.ExecHook) error
|
||||
ExecutePodCommand(log logrus.FieldLogger, item map[string]any, namespace, name, hookName string, hook *api.ExecHook) error
|
||||
}
|
||||
|
||||
type poster interface {
|
||||
@@ -67,7 +67,7 @@ func NewPodCommandExecutor(restClientConfig *rest.Config, restClient poster) Pod
|
||||
// command takes longer than the specified timeout, an error is returned (NOTE: it is not currently
|
||||
// possible to ensure the command is terminated when the timeout occurs, so it may continue to run
|
||||
// in the background).
|
||||
func (e *defaultPodCommandExecutor) ExecutePodCommand(log logrus.FieldLogger, item map[string]interface{}, namespace, name, hookName string, hook *api.ExecHook) error {
|
||||
func (e *defaultPodCommandExecutor) ExecutePodCommand(log logrus.FieldLogger, item map[string]any, namespace, name, hookName string, hook *api.ExecHook) error {
|
||||
if item == nil {
|
||||
return errors.New("item is required")
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ func TestNewPodCommandExecutor(t *testing.T) {
|
||||
func TestExecutePodCommandMissingInputs(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
item map[string]interface{}
|
||||
item map[string]any
|
||||
podNamespace string
|
||||
podName string
|
||||
hookName string
|
||||
@@ -63,22 +63,22 @@ func TestExecutePodCommandMissingInputs(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "missing pod namespace",
|
||||
item: map[string]interface{}{},
|
||||
item: map[string]any{},
|
||||
},
|
||||
{
|
||||
name: "missing pod name",
|
||||
item: map[string]interface{}{},
|
||||
item: map[string]any{},
|
||||
podNamespace: "ns",
|
||||
},
|
||||
{
|
||||
name: "missing hookName",
|
||||
item: map[string]interface{}{},
|
||||
item: map[string]any{},
|
||||
podNamespace: "ns",
|
||||
podName: "pod",
|
||||
},
|
||||
{
|
||||
name: "missing hook",
|
||||
item: map[string]interface{}{},
|
||||
item: map[string]any{},
|
||||
podNamespace: "ns",
|
||||
podName: "pod",
|
||||
hookName: "hook",
|
||||
|
||||
Reference in New Issue
Block a user