instance

package
v1.16.0-pre.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BGPInstance added in v1.16.0

type BGPInstance struct {
	Config   *v2alpha1api.CiliumBGPNodeInstance
	Router   types.Router
	Metadata map[string]any
}

BGPInstance is a container for providing interface with underlying router implementation.

This is used in BGPv2 implementation.

func NewBGPInstance added in v1.16.0

func NewBGPInstance(ctx context.Context, log *logrus.Entry, params types.ServerParameters) (*BGPInstance, error)

NewBGPInstance will start an underlying BGP instance utilizing types.ServerParameters for its initial configuration.

The returned BGPInstance has a nil CiliumBGPNodeInstance config, and is ready to be provided to ReconcileBGPConfigV2.

Canceling the provided context will kill the BGP instance along with calling the underlying Router's Stop() method.

func NewFakeBGPInstance added in v1.16.0

func NewFakeBGPInstance() *BGPInstance

NewFakeBGPInstance is fake BGP instance, to be used in unit tests.

type ServerWithConfig

type ServerWithConfig struct {
	// backed BgpServer configured in accordance to the accompanying
	// CiliumBGPVirtualRouter configuration.
	Server types.Router

	// The CiliumBGPVirtualRouter configuration which drives the configuration
	// of the above BgpServer.
	//
	// If this field is nil it means the above BgpServer has had no
	// configuration applied to it.
	Config *v2alpha1api.CiliumBGPVirtualRouter

	// ReconcilerMetadata holds reconciler-specific metadata keyed by the reconciler name,
	// opaque outside the respective reconciler.
	ReconcilerMetadata map[string]any
}

ServerWithConfig is a container for providing interface with underlying router implementation and Cilium's BGP control plane related configuration.

It exports a method set for manipulating the BgpServer. However, this struct is a dumb object. The calling code is required to keep the BgpServer's configuration and associated configuration fields in sync.

This is used in BGPv1 implementation.

func NewServerWithConfig

func NewServerWithConfig(ctx context.Context, log *logrus.Entry, params types.ServerParameters) (*ServerWithConfig, error)

NewServerWithConfig will start an underlying BgpServer utilizing types.ServerParameters for its initial configuration.

The returned ServerWithConfig has a nil CiliumBGPVirtualRouter config, and is ready to be provided to ReconcileBGPConfig.

Canceling the provided context will kill the BgpServer along with calling the underlying BgpServer's Stop() method.

Jump to

Keyboard shortcuts

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