diff --git a/pkg/cmd/server/server.go b/pkg/cmd/server/server.go index 58019aa03..077d6b456 100644 --- a/pkg/cmd/server/server.go +++ b/pkg/cmd/server/server.go @@ -61,7 +61,7 @@ import ( informers "github.com/heptio/velero/pkg/generated/informers/externalversions" "github.com/heptio/velero/pkg/metrics" "github.com/heptio/velero/pkg/persistence" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" "github.com/heptio/velero/pkg/podexec" "github.com/heptio/velero/pkg/restic" "github.com/heptio/velero/pkg/restore" @@ -203,8 +203,8 @@ type server struct { cancelFunc context.CancelFunc logger logrus.FieldLogger logLevel logrus.Level - pluginRegistry plugin.Registry - pluginManager plugin.Manager + pluginRegistry clientmgmt.Registry + pluginManager clientmgmt.Manager resticManager restic.RepositoryManager metrics *metrics.ServerMetrics config serverConfig @@ -235,11 +235,11 @@ func newServer(namespace, baseName string, config serverConfig, logger *logrus.L return nil, errors.WithStack(err) } - pluginRegistry := plugin.NewRegistry(config.pluginDir, logger, logger.Level) + pluginRegistry := clientmgmt.NewRegistry(config.pluginDir, logger, logger.Level) if err := pluginRegistry.DiscoverPlugins(); err != nil { return nil, err } - pluginManager := plugin.NewManager(logger, logger.Level, pluginRegistry) + pluginManager := clientmgmt.NewManager(logger, logger.Level, pluginRegistry) if err != nil { return nil, err } @@ -520,8 +520,8 @@ func (s *server) runControllers(defaultVolumeSnapshotLocations map[string]string // Initialize manual backup metrics s.metrics.InitSchedule("") - newPluginManager := func(logger logrus.FieldLogger) plugin.Manager { - return plugin.NewManager(logger, s.logLevel, s.pluginRegistry) + newPluginManager := func(logger logrus.FieldLogger) clientmgmt.Manager { + return clientmgmt.NewManager(logger, s.logLevel, s.pluginRegistry) } backupSyncController := controller.NewBackupSyncController( diff --git a/pkg/controller/backup_controller.go b/pkg/controller/backup_controller.go index b06800c91..81c6d4465 100644 --- a/pkg/controller/backup_controller.go +++ b/pkg/controller/backup_controller.go @@ -44,7 +44,7 @@ import ( listers "github.com/heptio/velero/pkg/generated/listers/velero/v1" "github.com/heptio/velero/pkg/metrics" "github.com/heptio/velero/pkg/persistence" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" "github.com/heptio/velero/pkg/util/collections" "github.com/heptio/velero/pkg/util/encode" kubeutil "github.com/heptio/velero/pkg/util/kube" @@ -60,7 +60,7 @@ type backupController struct { client velerov1client.BackupsGetter clock clock.Clock backupLogLevel logrus.Level - newPluginManager func(logrus.FieldLogger) plugin.Manager + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager backupTracker BackupTracker backupLocationLister listers.BackupStorageLocationLister defaultBackupLocation string @@ -76,7 +76,7 @@ func NewBackupController( backupper pkgbackup.Backupper, logger logrus.FieldLogger, backupLogLevel logrus.Level, - newPluginManager func(logrus.FieldLogger) plugin.Manager, + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupTracker BackupTracker, backupLocationInformer informers.BackupStorageLocationInformer, defaultBackupLocation string, diff --git a/pkg/controller/backup_controller_test.go b/pkg/controller/backup_controller_test.go index becf87840..d59d88c47 100644 --- a/pkg/controller/backup_controller_test.go +++ b/pkg/controller/backup_controller_test.go @@ -40,7 +40,7 @@ import ( "github.com/heptio/velero/pkg/metrics" "github.com/heptio/velero/pkg/persistence" persistencemocks "github.com/heptio/velero/pkg/persistence/mocks" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" pluginmocks "github.com/heptio/velero/pkg/plugin/mocks" "github.com/heptio/velero/pkg/plugin/velero" "github.com/heptio/velero/pkg/util/logging" @@ -305,7 +305,7 @@ func TestProcessBackupCompletions(t *testing.T) { backupTracker: NewBackupTracker(), metrics: metrics.NewServerMetrics(), clock: clock.NewFakeClock(now), - newPluginManager: func(logrus.FieldLogger) plugin.Manager { return pluginManager }, + newPluginManager: func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager }, newBackupStore: func(*v1.BackupStorageLocation, persistence.ObjectStoreGetter, logrus.FieldLogger) (persistence.BackupStore, error) { return backupStore, nil }, diff --git a/pkg/controller/backup_deletion_controller.go b/pkg/controller/backup_deletion_controller.go index 096475eca..17d713219 100644 --- a/pkg/controller/backup_deletion_controller.go +++ b/pkg/controller/backup_deletion_controller.go @@ -38,7 +38,7 @@ import ( informers "github.com/heptio/velero/pkg/generated/informers/externalversions/velero/v1" listers "github.com/heptio/velero/pkg/generated/listers/velero/v1" "github.com/heptio/velero/pkg/persistence" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" "github.com/heptio/velero/pkg/plugin/velero" "github.com/heptio/velero/pkg/restic" "github.com/heptio/velero/pkg/util/kube" @@ -61,7 +61,7 @@ type backupDeletionController struct { snapshotLocationLister listers.VolumeSnapshotLocationLister processRequestFunc func(*v1.DeleteBackupRequest) error clock clock.Clock - newPluginManager func(logrus.FieldLogger) plugin.Manager + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager newBackupStore func(*v1.BackupStorageLocation, persistence.ObjectStoreGetter, logrus.FieldLogger) (persistence.BackupStore, error) } @@ -78,7 +78,7 @@ func NewBackupDeletionController( podvolumeBackupInformer informers.PodVolumeBackupInformer, backupLocationInformer informers.BackupStorageLocationInformer, snapshotLocationInformer informers.VolumeSnapshotLocationInformer, - newPluginManager func(logrus.FieldLogger) plugin.Manager, + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, ) Interface { c := &backupDeletionController{ genericController: newGenericController("backup-deletion", logger), @@ -364,7 +364,7 @@ func (c *backupDeletionController) processRequest(req *v1.DeleteBackupRequest) e func blockStoreForSnapshotLocation( namespace, snapshotLocationName string, snapshotLocationLister listers.VolumeSnapshotLocationLister, - pluginManager plugin.Manager, + pluginManager clientmgmt.Manager, ) (velero.BlockStore, error) { snapshotLocation, err := snapshotLocationLister.VolumeSnapshotLocations(namespace).Get(snapshotLocationName) if err != nil { @@ -383,7 +383,7 @@ func blockStoreForSnapshotLocation( return blockStore, nil } -func (c *backupDeletionController) backupStoreForBackup(backup *v1.Backup, pluginManager plugin.Manager, log logrus.FieldLogger) (persistence.BackupStore, error) { +func (c *backupDeletionController) backupStoreForBackup(backup *v1.Backup, pluginManager clientmgmt.Manager, log logrus.FieldLogger) (persistence.BackupStore, error) { backupLocation, err := c.backupLocationLister.BackupStorageLocations(backup.Namespace).Get(backup.Spec.StorageLocation) if err != nil { return nil, errors.WithStack(err) diff --git a/pkg/controller/backup_deletion_controller_test.go b/pkg/controller/backup_deletion_controller_test.go index 64f4cb0ae..8c4fe5b4d 100644 --- a/pkg/controller/backup_deletion_controller_test.go +++ b/pkg/controller/backup_deletion_controller_test.go @@ -38,7 +38,7 @@ import ( informers "github.com/heptio/velero/pkg/generated/informers/externalversions" "github.com/heptio/velero/pkg/persistence" persistencemocks "github.com/heptio/velero/pkg/persistence/mocks" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" pluginmocks "github.com/heptio/velero/pkg/plugin/mocks" velerotest "github.com/heptio/velero/pkg/util/test" "github.com/heptio/velero/pkg/volume" @@ -146,7 +146,7 @@ func setupBackupDeletionControllerTest(objects ...runtime.Object) *backupDeletio sharedInformers.Velero().V1().PodVolumeBackups(), sharedInformers.Velero().V1().BackupStorageLocations(), sharedInformers.Velero().V1().VolumeSnapshotLocations(), - func(logrus.FieldLogger) plugin.Manager { return pluginManager }, + func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager }, ).(*backupDeletionController), req: req, @@ -389,7 +389,7 @@ func TestBackupDeletionControllerProcessRequest(t *testing.T) { pluginManager := &pluginmocks.Manager{} pluginManager.On("GetBlockStore", "provider-1").Return(td.blockStore, nil) pluginManager.On("CleanupClients") - td.controller.newPluginManager = func(logrus.FieldLogger) plugin.Manager { return pluginManager } + td.controller.newPluginManager = func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager } td.backupStore.On("DeleteBackup", td.req.Spec.BackupName).Return(nil) td.backupStore.On("DeleteRestore", "restore-1").Return(nil) @@ -528,7 +528,7 @@ func TestBackupDeletionControllerProcessRequest(t *testing.T) { pluginManager := &pluginmocks.Manager{} pluginManager.On("GetBlockStore", "provider-1").Return(td.blockStore, nil) pluginManager.On("CleanupClients") - td.controller.newPluginManager = func(logrus.FieldLogger) plugin.Manager { return pluginManager } + td.controller.newPluginManager = func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager } td.backupStore.On("GetBackupVolumeSnapshots", td.req.Spec.BackupName).Return(snapshots, nil) td.backupStore.On("DeleteBackup", td.req.Spec.BackupName).Return(nil) diff --git a/pkg/controller/backup_sync_controller.go b/pkg/controller/backup_sync_controller.go index 6ebbb0e99..120d2543c 100644 --- a/pkg/controller/backup_sync_controller.go +++ b/pkg/controller/backup_sync_controller.go @@ -34,7 +34,7 @@ import ( informers "github.com/heptio/velero/pkg/generated/informers/externalversions/velero/v1" listers "github.com/heptio/velero/pkg/generated/listers/velero/v1" "github.com/heptio/velero/pkg/persistence" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" "github.com/heptio/velero/pkg/util/stringslice" ) @@ -47,7 +47,7 @@ type backupSyncController struct { backupStorageLocationLister listers.BackupStorageLocationLister namespace string defaultBackupLocation string - newPluginManager func(logrus.FieldLogger) plugin.Manager + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager newBackupStore func(*velerov1api.BackupStorageLocation, persistence.ObjectStoreGetter, logrus.FieldLogger) (persistence.BackupStore, error) } @@ -59,7 +59,7 @@ func NewBackupSyncController( syncPeriod time.Duration, namespace string, defaultBackupLocation string, - newPluginManager func(logrus.FieldLogger) plugin.Manager, + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, logger logrus.FieldLogger, ) Interface { if syncPeriod < time.Minute { diff --git a/pkg/controller/backup_sync_controller_test.go b/pkg/controller/backup_sync_controller_test.go index ba82cd0ad..20a8600ec 100644 --- a/pkg/controller/backup_sync_controller_test.go +++ b/pkg/controller/backup_sync_controller_test.go @@ -35,7 +35,7 @@ import ( informers "github.com/heptio/velero/pkg/generated/informers/externalversions" "github.com/heptio/velero/pkg/persistence" persistencemocks "github.com/heptio/velero/pkg/persistence/mocks" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" pluginmocks "github.com/heptio/velero/pkg/plugin/mocks" "github.com/heptio/velero/pkg/util/stringslice" velerotest "github.com/heptio/velero/pkg/util/test" @@ -193,7 +193,7 @@ func TestBackupSyncControllerRun(t *testing.T) { time.Duration(0), test.namespace, "", - func(logrus.FieldLogger) plugin.Manager { return pluginManager }, + func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager }, velerotest.NewLogger(), ).(*backupSyncController) diff --git a/pkg/controller/download_request_controller.go b/pkg/controller/download_request_controller.go index 698055da5..fcd4141f3 100644 --- a/pkg/controller/download_request_controller.go +++ b/pkg/controller/download_request_controller.go @@ -35,7 +35,7 @@ import ( informers "github.com/heptio/velero/pkg/generated/informers/externalversions/velero/v1" listers "github.com/heptio/velero/pkg/generated/listers/velero/v1" "github.com/heptio/velero/pkg/persistence" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" "github.com/heptio/velero/pkg/util/kube" ) @@ -48,7 +48,7 @@ type downloadRequestController struct { clock clock.Clock backupLocationLister listers.BackupStorageLocationLister backupLister listers.BackupLister - newPluginManager func(logrus.FieldLogger) plugin.Manager + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager newBackupStore func(*v1.BackupStorageLocation, persistence.ObjectStoreGetter, logrus.FieldLogger) (persistence.BackupStore, error) } @@ -59,7 +59,7 @@ func NewDownloadRequestController( restoreInformer informers.RestoreInformer, backupLocationInformer informers.BackupStorageLocationInformer, backupInformer informers.BackupInformer, - newPluginManager func(logrus.FieldLogger) plugin.Manager, + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, logger logrus.FieldLogger, ) Interface { c := &downloadRequestController{ diff --git a/pkg/controller/download_request_controller_test.go b/pkg/controller/download_request_controller_test.go index 54a229656..0615d7a03 100644 --- a/pkg/controller/download_request_controller_test.go +++ b/pkg/controller/download_request_controller_test.go @@ -32,7 +32,7 @@ import ( informers "github.com/heptio/velero/pkg/generated/informers/externalversions" "github.com/heptio/velero/pkg/persistence" persistencemocks "github.com/heptio/velero/pkg/persistence/mocks" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" pluginmocks "github.com/heptio/velero/pkg/plugin/mocks" kubeutil "github.com/heptio/velero/pkg/util/kube" velerotest "github.com/heptio/velero/pkg/util/test" @@ -59,7 +59,7 @@ func newDownloadRequestTestHarness(t *testing.T) *downloadRequestTestHarness { informerFactory.Velero().V1().Restores(), informerFactory.Velero().V1().BackupStorageLocations(), informerFactory.Velero().V1().Backups(), - func(logrus.FieldLogger) plugin.Manager { return pluginManager }, + func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager }, velerotest.NewLogger(), ).(*downloadRequestController) ) diff --git a/pkg/controller/restore_controller.go b/pkg/controller/restore_controller.go index 977439204..b2dd0dedd 100644 --- a/pkg/controller/restore_controller.go +++ b/pkg/controller/restore_controller.go @@ -40,7 +40,7 @@ import ( listers "github.com/heptio/velero/pkg/generated/listers/velero/v1" "github.com/heptio/velero/pkg/metrics" "github.com/heptio/velero/pkg/persistence" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" "github.com/heptio/velero/pkg/plugin/velero" "github.com/heptio/velero/pkg/restore" "github.com/heptio/velero/pkg/util/collections" @@ -87,7 +87,7 @@ type restoreController struct { defaultBackupLocation string metrics *metrics.ServerMetrics - newPluginManager func(logger logrus.FieldLogger) plugin.Manager + newPluginManager func(logger logrus.FieldLogger) clientmgmt.Manager newBackupStore func(*api.BackupStorageLocation, persistence.ObjectStoreGetter, logrus.FieldLogger) (persistence.BackupStore, error) } @@ -106,7 +106,7 @@ func NewRestoreController( snapshotLocationInformer informers.VolumeSnapshotLocationInformer, logger logrus.FieldLogger, restoreLogLevel logrus.Level, - newPluginManager func(logrus.FieldLogger) plugin.Manager, + newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, defaultBackupLocation string, metrics *metrics.ServerMetrics, ) Interface { @@ -285,7 +285,7 @@ type backupInfo struct { backupStore persistence.BackupStore } -func (c *restoreController) validateAndComplete(restore *api.Restore, pluginManager plugin.Manager) backupInfo { +func (c *restoreController) validateAndComplete(restore *api.Restore, pluginManager clientmgmt.Manager) backupInfo { // add non-restorable resources to restore's excluded resources excludedResources := sets.NewString(restore.Spec.ExcludedResources...) for _, nonrestorable := range nonRestorableResources { @@ -409,7 +409,7 @@ func mostRecentCompletedBackup(backups []*api.Backup) *api.Backup { // fetchBackupInfo checks the backup lister for a backup that matches the given name. If it doesn't // find it, it returns an error. -func (c *restoreController) fetchBackupInfo(backupName string, pluginManager plugin.Manager) (backupInfo, error) { +func (c *restoreController) fetchBackupInfo(backupName string, pluginManager clientmgmt.Manager) (backupInfo, error) { backup, err := c.backupLister.Backups(c.namespace).Get(backupName) if err != nil { return backupInfo{}, err @@ -435,7 +435,7 @@ func (c *restoreController) runRestore( restore *api.Restore, actions []velero.RestoreItemAction, info backupInfo, - pluginManager plugin.Manager, + pluginManager clientmgmt.Manager, ) (restoreResult, error) { var restoreWarnings, restoreErrors api.RestoreResult var restoreFailure error diff --git a/pkg/controller/restore_controller_test.go b/pkg/controller/restore_controller_test.go index ad7fe3b28..705694540 100644 --- a/pkg/controller/restore_controller_test.go +++ b/pkg/controller/restore_controller_test.go @@ -43,7 +43,7 @@ import ( "github.com/heptio/velero/pkg/metrics" "github.com/heptio/velero/pkg/persistence" persistencemocks "github.com/heptio/velero/pkg/persistence/mocks" - "github.com/heptio/velero/pkg/plugin" + "github.com/heptio/velero/pkg/plugin/clientmgmt" pluginmocks "github.com/heptio/velero/pkg/plugin/mocks" "github.com/heptio/velero/pkg/plugin/velero" "github.com/heptio/velero/pkg/restore" @@ -110,7 +110,7 @@ func TestFetchBackupInfo(t *testing.T) { sharedInformers.Velero().V1().VolumeSnapshotLocations(), logger, logrus.InfoLevel, - func(logrus.FieldLogger) plugin.Manager { return pluginManager }, + func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager }, "default", metrics.NewServerMetrics(), ).(*restoreController) @@ -408,7 +408,7 @@ func TestProcessRestore(t *testing.T) { sharedInformers.Velero().V1().VolumeSnapshotLocations(), logger, logrus.InfoLevel, - func(logrus.FieldLogger) plugin.Manager { return pluginManager }, + func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager }, "default", metrics.NewServerMetrics(), ).(*restoreController) diff --git a/pkg/plugin/client_builder.go b/pkg/plugin/clientmgmt/client_builder.go similarity index 97% rename from pkg/plugin/client_builder.go rename to pkg/plugin/clientmgmt/client_builder.go index 0c64dda0b..bbc9fe817 100644 --- a/pkg/plugin/client_builder.go +++ b/pkg/plugin/clientmgmt/client_builder.go @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +// Package clientmgmt contains the plugin client for Velero. +package clientmgmt import ( "os" diff --git a/pkg/plugin/client_builder_test.go b/pkg/plugin/clientmgmt/client_builder_test.go similarity index 99% rename from pkg/plugin/client_builder_test.go rename to pkg/plugin/clientmgmt/client_builder_test.go index c9c4cf91a..bcc835597 100644 --- a/pkg/plugin/client_builder_test.go +++ b/pkg/plugin/clientmgmt/client_builder_test.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +package clientmgmt import ( "os" diff --git a/pkg/plugin/logrus_adapter.go b/pkg/plugin/clientmgmt/logrus_adapter.go similarity index 99% rename from pkg/plugin/logrus_adapter.go rename to pkg/plugin/clientmgmt/logrus_adapter.go index c6c699c4b..23f98795c 100644 --- a/pkg/plugin/logrus_adapter.go +++ b/pkg/plugin/clientmgmt/logrus_adapter.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "fmt" diff --git a/pkg/plugin/logrus_adapter_test.go b/pkg/plugin/clientmgmt/logrus_adapter_test.go similarity index 99% rename from pkg/plugin/logrus_adapter_test.go rename to pkg/plugin/clientmgmt/logrus_adapter_test.go index c31fd4d4a..895761464 100644 --- a/pkg/plugin/logrus_adapter_test.go +++ b/pkg/plugin/clientmgmt/logrus_adapter_test.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "testing" diff --git a/pkg/plugin/manager.go b/pkg/plugin/clientmgmt/manager.go similarity index 99% rename from pkg/plugin/manager.go rename to pkg/plugin/clientmgmt/manager.go index 78225e04f..052b6f162 100644 --- a/pkg/plugin/manager.go +++ b/pkg/plugin/clientmgmt/manager.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "sync" diff --git a/pkg/plugin/manager_test.go b/pkg/plugin/clientmgmt/manager_test.go similarity index 99% rename from pkg/plugin/manager_test.go rename to pkg/plugin/clientmgmt/manager_test.go index 8cb64c3f3..9f580ef5c 100644 --- a/pkg/plugin/manager_test.go +++ b/pkg/plugin/clientmgmt/manager_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "fmt" diff --git a/pkg/plugin/process.go b/pkg/plugin/clientmgmt/process.go similarity index 99% rename from pkg/plugin/process.go rename to pkg/plugin/clientmgmt/process.go index 27d600b7d..6ad57c55f 100644 --- a/pkg/plugin/process.go +++ b/pkg/plugin/clientmgmt/process.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +package clientmgmt import ( plugin "github.com/hashicorp/go-plugin" diff --git a/pkg/plugin/process_test.go b/pkg/plugin/clientmgmt/process_test.go similarity index 99% rename from pkg/plugin/process_test.go rename to pkg/plugin/clientmgmt/process_test.go index d67c04966..175391838 100644 --- a/pkg/plugin/process_test.go +++ b/pkg/plugin/clientmgmt/process_test.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "testing" diff --git a/pkg/plugin/registry.go b/pkg/plugin/clientmgmt/registry.go similarity index 99% rename from pkg/plugin/registry.go rename to pkg/plugin/clientmgmt/registry.go index 5b34a0b39..279411f7f 100644 --- a/pkg/plugin/registry.go +++ b/pkg/plugin/clientmgmt/registry.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +package clientmgmt import ( "fmt" diff --git a/pkg/plugin/registry_test.go b/pkg/plugin/clientmgmt/registry_test.go similarity index 99% rename from pkg/plugin/registry_test.go rename to pkg/plugin/clientmgmt/registry_test.go index a2b9a556a..929a92723 100644 --- a/pkg/plugin/registry_test.go +++ b/pkg/plugin/clientmgmt/registry_test.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "os" diff --git a/pkg/plugin/restartable_backup_item_action.go b/pkg/plugin/clientmgmt/restartable_backup_item_action.go similarity index 99% rename from pkg/plugin/restartable_backup_item_action.go rename to pkg/plugin/clientmgmt/restartable_backup_item_action.go index 3254bb60d..d73442200 100644 --- a/pkg/plugin/restartable_backup_item_action.go +++ b/pkg/plugin/clientmgmt/restartable_backup_item_action.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +package clientmgmt import ( "github.com/pkg/errors" diff --git a/pkg/plugin/restartable_backup_item_action_test.go b/pkg/plugin/clientmgmt/restartable_backup_item_action_test.go similarity index 99% rename from pkg/plugin/restartable_backup_item_action_test.go rename to pkg/plugin/clientmgmt/restartable_backup_item_action_test.go index dc5c14632..73f2340cd 100644 --- a/pkg/plugin/restartable_backup_item_action_test.go +++ b/pkg/plugin/clientmgmt/restartable_backup_item_action_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "testing" diff --git a/pkg/plugin/restartable_block_store.go b/pkg/plugin/clientmgmt/restartable_block_store.go similarity index 99% rename from pkg/plugin/restartable_block_store.go rename to pkg/plugin/clientmgmt/restartable_block_store.go index 8c2122c19..a53cef757 100644 --- a/pkg/plugin/restartable_block_store.go +++ b/pkg/plugin/clientmgmt/restartable_block_store.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +package clientmgmt import ( "github.com/pkg/errors" diff --git a/pkg/plugin/restartable_block_store_test.go b/pkg/plugin/clientmgmt/restartable_block_store_test.go similarity index 99% rename from pkg/plugin/restartable_block_store_test.go rename to pkg/plugin/clientmgmt/restartable_block_store_test.go index c79c96c2c..988105a63 100644 --- a/pkg/plugin/restartable_block_store_test.go +++ b/pkg/plugin/clientmgmt/restartable_block_store_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "testing" diff --git a/pkg/plugin/restartable_delegate_test.go b/pkg/plugin/clientmgmt/restartable_delegate_test.go similarity index 99% rename from pkg/plugin/restartable_delegate_test.go rename to pkg/plugin/clientmgmt/restartable_delegate_test.go index 7e45a9af6..0a630c61b 100644 --- a/pkg/plugin/restartable_delegate_test.go +++ b/pkg/plugin/clientmgmt/restartable_delegate_test.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "reflect" diff --git a/pkg/plugin/restartable_object_store.go b/pkg/plugin/clientmgmt/restartable_object_store.go similarity index 99% rename from pkg/plugin/restartable_object_store.go rename to pkg/plugin/clientmgmt/restartable_object_store.go index 6b656f3a0..23bb8646e 100644 --- a/pkg/plugin/restartable_object_store.go +++ b/pkg/plugin/clientmgmt/restartable_object_store.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +package clientmgmt import ( "io" diff --git a/pkg/plugin/restartable_object_store_test.go b/pkg/plugin/clientmgmt/restartable_object_store_test.go similarity index 99% rename from pkg/plugin/restartable_object_store_test.go rename to pkg/plugin/clientmgmt/restartable_object_store_test.go index 855d3ef82..7855692da 100644 --- a/pkg/plugin/restartable_object_store_test.go +++ b/pkg/plugin/clientmgmt/restartable_object_store_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "io/ioutil" diff --git a/pkg/plugin/restartable_process.go b/pkg/plugin/clientmgmt/restartable_process.go similarity index 99% rename from pkg/plugin/restartable_process.go rename to pkg/plugin/clientmgmt/restartable_process.go index e63fe0bcd..f98d6d3e5 100644 --- a/pkg/plugin/restartable_process.go +++ b/pkg/plugin/clientmgmt/restartable_process.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +package clientmgmt import ( "sync" diff --git a/pkg/plugin/restartable_restore_item_action.go b/pkg/plugin/clientmgmt/restartable_restore_item_action.go similarity index 99% rename from pkg/plugin/restartable_restore_item_action.go rename to pkg/plugin/clientmgmt/restartable_restore_item_action.go index 6624b5475..9f804f983 100644 --- a/pkg/plugin/restartable_restore_item_action.go +++ b/pkg/plugin/clientmgmt/restartable_restore_item_action.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package plugin + +package clientmgmt import ( "github.com/pkg/errors" diff --git a/pkg/plugin/restartable_restore_item_action_test.go b/pkg/plugin/clientmgmt/restartable_restore_item_action_test.go similarity index 99% rename from pkg/plugin/restartable_restore_item_action_test.go rename to pkg/plugin/clientmgmt/restartable_restore_item_action_test.go index 53d63a610..a681ddbe7 100644 --- a/pkg/plugin/restartable_restore_item_action_test.go +++ b/pkg/plugin/clientmgmt/restartable_restore_item_action_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package plugin +package clientmgmt import ( "testing" diff --git a/pkg/plugin/mocks/process_factory.go b/pkg/plugin/mocks/process_factory.go index 1374fc558..1f80b14b0 100644 --- a/pkg/plugin/mocks/process_factory.go +++ b/pkg/plugin/mocks/process_factory.go @@ -18,7 +18,7 @@ package mocks import logrus "github.com/sirupsen/logrus" import mock "github.com/stretchr/testify/mock" -import plugin "github.com/heptio/velero/pkg/plugin" +import "github.com/heptio/velero/pkg/plugin/clientmgmt" // ProcessFactory is an autogenerated mock type for the ProcessFactory type type ProcessFactory struct { @@ -26,15 +26,15 @@ type ProcessFactory struct { } // newProcess provides a mock function with given fields: command, logger, logLevel -func (_m *ProcessFactory) newProcess(command string, logger logrus.FieldLogger, logLevel logrus.Level) (plugin.Process, error) { +func (_m *ProcessFactory) newProcess(command string, logger logrus.FieldLogger, logLevel logrus.Level) (clientmgmt.Process, error) { ret := _m.Called(command, logger, logLevel) - var r0 plugin.Process - if rf, ok := ret.Get(0).(func(string, logrus.FieldLogger, logrus.Level) plugin.Process); ok { + var r0 clientmgmt.Process + if rf, ok := ret.Get(0).(func(string, logrus.FieldLogger, logrus.Level) clientmgmt.Process); ok { r0 = rf(command, logger, logLevel) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(plugin.Process) + r0 = ret.Get(0).(clientmgmt.Process) } }