Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd provides methods for the CNI ADD, DEL and CHECK commands.
func NewCmd ¶
NewCmd creates a new Cmd instance, whose Add, Del and Check methods can be passed to skel.PluginMain
type ConfigurationParams ¶
type ConfigurationParams struct { Log *logrus.Entry Conf *models.DaemonConfigurationStatus Args *skel.CmdArgs CniArgs *types.ArgsSpec }
ConfigurationParams contains the arguments and Cilium configuration of a CNI invocation. Those fields may be used by custom implementations of the EndpointConfigurator interface to customize the CNI ADD call.
type DefaultConfigurator ¶
type DefaultConfigurator struct{}
DefaultConfigurator is the default endpoint configurator. It configures a single endpoint for the interface name provided by the CNI ADD invocation, using an auto-selected IPAM pool.
func (*DefaultConfigurator) GetConfigurations ¶
func (c *DefaultConfigurator) GetConfigurations(p ConfigurationParams) ([]EndpointConfiguration, error)
GetConfigurations returns a single a default configuration
type EndpointConfiguration ¶
type EndpointConfiguration interface { // IfName specifies the container interface name to be used for this endpoint IfName() string // IPAMPool specifies which IPAM pool the endpoint's IP should be allocated from IPAMPool() string // PrepareEndpoint returns the interface configuration 'cmd' of the container // namespace as well as the template for the endpoint creation request 'ep'. PrepareEndpoint(ipam *models.IPAMResponse) (cmd *CmdState, ep *models.EndpointChangeRequest, err error) }
EndpointConfiguration determines the configuration of an endpoint to be created during a CNI ADD invocation.
type EndpointConfigurator ¶
type EndpointConfigurator interface {
GetConfigurations(p ConfigurationParams) ([]EndpointConfiguration, error)
}
EndpointConfigurator returns a list of endpoint configurations for a given CNI ADD invocation. If the CNI ADD invocation should result in multiple endpoints being created, it may return multiple endpoint configurations, one for each endpoint.
type Option ¶
type Option func(cmd *Cmd)
Option allows the customization of the Cmd implementation
func WithEPConfigurator ¶
func WithEPConfigurator(cfg EndpointConfigurator) Option
WithEPConfigurator is used to create a Cmd instance with a custom endpoint configurator. The endpoint configurator can be used to customize the creation of endpoints during the CNI ADD invocation. This function is exported to be accessed outside the tree.