mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
e06e2ef107
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
79 lines
1.9 KiB
Go
79 lines
1.9 KiB
Go
package plugin
|
|
|
|
import (
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/docker/swarmkit/api"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
// Controller is the controller for the plugin backend
|
|
type Controller struct{}
|
|
|
|
// NewController returns a new cluster plugin controller
|
|
func NewController() (*Controller, error) {
|
|
return &Controller{}, nil
|
|
}
|
|
|
|
// Update is the update phase from swarmkit
|
|
func (p *Controller) Update(ctx context.Context, t *api.Task) error {
|
|
logrus.WithFields(logrus.Fields{
|
|
"controller": "plugin",
|
|
}).Debug("Update")
|
|
return nil
|
|
}
|
|
|
|
// Prepare is the prepare phase from swarmkit
|
|
func (p *Controller) Prepare(ctx context.Context) error {
|
|
logrus.WithFields(logrus.Fields{
|
|
"controller": "plugin",
|
|
}).Debug("Prepare")
|
|
return nil
|
|
}
|
|
|
|
// Start is the start phase from swarmkit
|
|
func (p *Controller) Start(ctx context.Context) error {
|
|
logrus.WithFields(logrus.Fields{
|
|
"controller": "plugin",
|
|
}).Debug("Start")
|
|
return nil
|
|
}
|
|
|
|
// Wait causes the task to wait until returned
|
|
func (p *Controller) Wait(ctx context.Context) error {
|
|
logrus.WithFields(logrus.Fields{
|
|
"controller": "plugin",
|
|
}).Debug("Wait")
|
|
return nil
|
|
}
|
|
|
|
// Shutdown is the shutdown phase from swarmkit
|
|
func (p *Controller) Shutdown(ctx context.Context) error {
|
|
logrus.WithFields(logrus.Fields{
|
|
"controller": "plugin",
|
|
}).Debug("Shutdown")
|
|
return nil
|
|
}
|
|
|
|
// Terminate is the terminate phase from swarmkit
|
|
func (p *Controller) Terminate(ctx context.Context) error {
|
|
logrus.WithFields(logrus.Fields{
|
|
"controller": "plugin",
|
|
}).Debug("Terminate")
|
|
return nil
|
|
}
|
|
|
|
// Remove is the remove phase from swarmkit
|
|
func (p *Controller) Remove(ctx context.Context) error {
|
|
logrus.WithFields(logrus.Fields{
|
|
"controller": "plugin",
|
|
}).Debug("Remove")
|
|
return nil
|
|
}
|
|
|
|
// Close is the close phase from swarmkit
|
|
func (p *Controller) Close() error {
|
|
logrus.WithFields(logrus.Fields{
|
|
"controller": "plugin",
|
|
}).Debug("Close")
|
|
return nil
|
|
}
|