api

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 25

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, client *client.Client) (res *cniTypesVer.Result, err error)

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

	// Check is called on CNI CHECK. The plugin should verify (to the best of its
	// ability) that everything is reasonably configured, else return error.
	Check(ctx context.Context, pluginContext PluginContext, client *client.Client) error
}

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
	CiliumConf *models.DaemonConfigurationStatus
}

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