Refactor plugin management

Refactor plugin management:
- support multiple plugins per executable
- support restarting a plugin process in the event it terminates
- simplify plugin lifecycle management by using separate managers for
  each scope (server vs backup vs restore)

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
Andy Goldstein
2018-05-13 09:28:09 -04:00
committed by Steve Kriss
parent 131afb571e
commit 130512187a
101 changed files with 5991 additions and 1891 deletions

View File

@@ -40,7 +40,7 @@ import (
type backupSyncController struct {
client arkv1client.BackupsGetter
backupService cloudprovider.BackupService
cloudBackupLister cloudprovider.BackupLister
bucket string
syncPeriod time.Duration
namespace string
@@ -51,7 +51,7 @@ type backupSyncController struct {
func NewBackupSyncController(
client arkv1client.BackupsGetter,
backupService cloudprovider.BackupService,
cloudBackupLister cloudprovider.BackupLister,
bucket string,
syncPeriod time.Duration,
namespace string,
@@ -64,7 +64,7 @@ func NewBackupSyncController(
}
return &backupSyncController{
client: client,
backupService: backupService,
cloudBackupLister: cloudBackupLister,
bucket: bucket,
syncPeriod: syncPeriod,
namespace: namespace,
@@ -92,7 +92,7 @@ const gcFinalizer = "gc.ark.heptio.com"
func (c *backupSyncController) run() {
c.logger.Info("Syncing backups from object storage")
backups, err := c.backupService.GetAllBackups(c.bucket)
backups, err := c.cloudBackupLister.ListBackups(c.bucket)
if err != nil {
c.logger.WithError(err).Error("error listing backups")
return