plugin

package
v20.10.24+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Disable(name string, config *enginetypes.PluginDisableConfig) error
	Enable(name string, config *enginetypes.PluginEnableConfig) error
	Remove(name string, config *enginetypes.PluginRmConfig) error
	Pull(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *enginetypes.AuthConfig, privileges enginetypes.PluginPrivileges, outStream io.Writer, opts ...plugin.CreateOpt) error
	Upgrade(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *enginetypes.AuthConfig, privileges enginetypes.PluginPrivileges, outStream io.Writer) error
	Get(name string) (*v2.Plugin, error)
	SubscribeEvents(buffer int, events ...plugin.Event) (eventCh <-chan interface{}, cancel func())
}

Backend is the interface for interacting with the plugin manager Controller actions are passed to the configured backend to do the real work.

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is the controller for the plugin backend. Plugins are managed as a singleton object with a desired state (different from containers). With the plugin controller instead of having a strict create->start->stop->remove task lifecycle like containers, we manage the desired state of the plugin and let the plugin manager do what it already does and monitor the plugin. We'll also end up with many tasks all pointing to the same plugin ID.

TODO(@cpuguy83): registry auth is intentionally not supported until we work out the right way to pass registry credentials via secrets.

func NewController

func NewController(backend Backend, t *api.Task) (*Controller, error)

NewController returns a new cluster plugin controller

func (*Controller) Close

func (p *Controller) Close() error

Close is the close phase from swarmkit

func (*Controller) Prepare

func (p *Controller) Prepare(ctx context.Context) (err error)

Prepare is the prepare phase from swarmkit

func (*Controller) Remove

func (p *Controller) Remove(ctx context.Context) error

Remove is the remove phase from swarmkit

func (*Controller) Shutdown

func (p *Controller) Shutdown(ctx context.Context) error

Shutdown is the shutdown phase from swarmkit

func (*Controller) Start

func (p *Controller) Start(ctx context.Context) error

Start is the start phase from swarmkit

func (*Controller) Terminate

func (p *Controller) Terminate(ctx context.Context) error

Terminate is the terminate phase from swarmkit

func (*Controller) Update

func (p *Controller) Update(ctx context.Context, t *api.Task) error

Update is the update phase from swarmkit

func (*Controller) Wait

func (p *Controller) Wait(ctx context.Context) error

Wait causes the task to wait until returned

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL