api

package
v1.6.12 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfigName is the name used by default in the standard CNI
	// configuration
	DefaultConfigName = "cilium"
)

Variables

This section is empty.

Functions

func Register

func Register(name string, p ChainingPlugin) error

Register is called by chaining plugins to register themselves. After Register(), the plugin can be found with Lookup().

Types

type ChainingPlugin

type ChainingPlugin interface {
	// Add is called on CNI ADD. It is given the plugin context from the
	// previous plugin. It must return a CNI result or an error.
	Add(ctx context.Context, pluginContext PluginContext) (res *cniTypesVer.Result, err error)

	// ImplementsAdd returns true if the chaining plugin implements its own
	// add logic
	ImplementsAdd() bool

	// Delete is called on CNI DELETE. It is given the plugin context from
	// the previous plugin.
	Delete(ctx context.Context, pluginContext PluginContext) (err error)

	// ImplementsDelete returns true if the chaining plugin implements its
	// own delete logic
	ImplementsDelete() bool
}

ChainingPlugin is the interface each chaining plugin must implement

func Lookup

func Lookup(name string) ChainingPlugin

Lookup searches for a chaining plugin with a given name and returns it

type PluginContext

type PluginContext struct {
	Logger  *logrus.Entry
	Args    *skel.CmdArgs
	CniArgs types.ArgsSpec
	NetConf *types.NetConf
	Client  *client.Client
}

PluginContext is the context given to chaining plugins

Jump to

Keyboard shortcuts

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