diff --git a/pkg/apis/velero/v1/pod_volume_operation_progress.go b/pkg/apis/velero/v1/pod_volume_operation_progress.go index b4e314276e..ceb67a87ea 100644 --- a/pkg/apis/velero/v1/pod_volume_operation_progress.go +++ b/pkg/apis/velero/v1/pod_volume_operation_progress.go @@ -1,5 +1,5 @@ /* -Copyright 2019 the Velero contributors. +Copyright The Velero Contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/controller/pod_volume_backup_controller_test.go b/pkg/controller/pod_volume_backup_controller_test.go index 736e0ea229..a341dd0d92 100644 --- a/pkg/controller/pod_volume_backup_controller_test.go +++ b/pkg/controller/pod_volume_backup_controller_test.go @@ -24,9 +24,9 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" - apierrors "k8s.io/apimachinery/pkg/api/errors" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/clock" diff --git a/pkg/restic/executer.go b/pkg/restic/executer.go index daa3db40c5..3ef0ea9a8f 100644 --- a/pkg/restic/executer.go +++ b/pkg/restic/executer.go @@ -17,6 +17,7 @@ limitations under the License. package restic import ( + "github.com/pkg/errors" "github.com/sirupsen/logrus" velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1" @@ -24,15 +25,19 @@ import ( // BackupExecuter ... type BackupExecuter interface { - RunBackup(*Command, logrus.FieldLogger, func(velerov1api.PodVolumeOperationProgress)) (string, string, error) + RunBackup(interface{}, logrus.FieldLogger, func(velerov1api.PodVolumeOperationProgress)) (string, string, error) GetSnapshotID(string, string, map[string]string, []string, string) (string, error) } -// Backup ... +// BackupExec ... type BackupExec struct{} // RunBackup ... -func (exec BackupExec) RunBackup(cmd *Command, log logrus.FieldLogger, updateFn func(velerov1api.PodVolumeOperationProgress)) (string, string, error) { +func (exec BackupExec) RunBackup(command interface{}, log logrus.FieldLogger, updateFn func(velerov1api.PodVolumeOperationProgress)) (string, string, error) { + cmd, ok := command.(*Command) + if !ok { + return "", "", errors.New("expecting command to be of type *restic.Command") + } return RunBackup(cmd, log, updateFn) } diff --git a/pkg/test/fake_restic_executer.go b/pkg/test/fake_restic_executer.go index 25c459f6d8..7810f1447c 100644 --- a/pkg/test/fake_restic_executer.go +++ b/pkg/test/fake_restic_executer.go @@ -18,16 +18,14 @@ package test import ( "github.com/sirupsen/logrus" - velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1" - "github.com/vmware-tanzu/velero/pkg/restic" ) -// Backup ... +// FakeResticBackupExec ... type FakeResticBackupExec struct{} // RunBackup ... -func (exec FakeResticBackupExec) RunBackup(cmd *restic.Command, log logrus.FieldLogger, updateFn func(velerov1api.PodVolumeOperationProgress)) (string, string, error) { +func (exec FakeResticBackupExec) RunBackup(cmd interface{}, log logrus.FieldLogger, updateFn func(velerov1api.PodVolumeOperationProgress)) (string, string, error) { return "", "", nil }