controllers: take a newPluginManager func in constructors

Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
Steve Kriss
2018-08-28 13:19:21 -07:00
parent 6445dbf1c7
commit 729d733986
11 changed files with 40 additions and 78 deletions
@@ -177,14 +177,13 @@ func TestBackupSyncControllerRun(t *testing.T) {
time.Duration(0),
test.namespace,
"",
nil, // pluginRegistry
func(logrus.FieldLogger) plugin.Manager { return pluginManager },
arktest.NewLogger(),
logrus.DebugLevel,
).(*backupSyncController)
c.newPluginManager = func(_ logrus.FieldLogger) plugin.Manager { return pluginManager }
pluginManager.On("GetObjectStore", "objStoreProvider").Return(objectStore, nil)
pluginManager.On("CleanupClients").Return(nil)
objectStore.On("Init", mock.Anything).Return(nil)
for _, location := range test.locations {
@@ -343,9 +342,8 @@ func TestDeleteOrphanedBackups(t *testing.T) {
time.Duration(0),
test.namespace,
"",
nil, // pluginRegistry
nil, // new plugin manager func
arktest.NewLogger(),
logrus.InfoLevel,
).(*backupSyncController)
expectedDeleteActions := make([]core.Action, 0)