Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidPrimaryIP indicates the NC primary IP is invalid. ErrInvalidPrimaryIP = errors.New("invalid primary IP") // ErrInvalidSecondaryIP indicates that a secondary IP on the NC is invalid. ErrInvalidSecondaryIP = errors.New("invalid secondary IP") // ErrUnsupportedNCQuantity indicates that the node has an unsupported nummber of Network Containers attached. ErrUnsupportedNCQuantity = errors.New("unsupported number of network containers") )
Functions ¶
func CreateNCRequestFromDynamicNC ¶
func CreateNCRequestFromDynamicNC(nc v1alpha.NetworkContainer) (*cns.CreateNetworkContainerRequest, error)
CreateNCRequestFromDynamicNC generates a CreateNetworkContainerRequest from a dynamic NetworkContainer.
func CreateNCRequestFromStaticNC ¶
func CreateNCRequestFromStaticNC(nc v1alpha.NetworkContainer) (*cns.CreateNetworkContainerRequest, error)
CreateNCRequestFromStaticNC generates a CreateNetworkContainerRequest from a static NetworkContainer.
Types ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler watches for CRD status changes
func NewReconciler ¶
func NewReconciler(cnscli cnsClient, ipampoolmonitorcli nodeNetworkConfigListener, nodeIP string) *Reconciler
NewReconciler creates a NodeNetworkConfig Reconciler which will get updates from the Kubernetes apiserver for NNC events. Provided nncListeners are passed the NNC after the Reconcile preprocesses it. Note: order matters! The passed Listeners are notified in the order provided.
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)
Reconcile is called on CRD status changes
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, node *v1.Node, filterGenerationChange bool) error
SetupWithManager Sets up the reconciler with a new manager, filtering using NodeNetworkConfigFilter on nodeName. filterGenerationChange will check the old and new object's generation and only reconcile updates where the generation is the same. This is typically used in IPAMv1 but should be set to false in IPAMv2.
func (*Reconciler) Started ¶
func (r *Reconciler) Started(ctx context.Context) (bool, error)
Started blocks until the Reconciler has reconciled at least once, then, and any time that it is called after that, it immediately returns true. It accepts a cancellable Context and if the context is closed before Start it will return false. Passing a closed Context after the Reconciler is started is indeterminate.
type ScopedClient ¶
type ScopedClient struct { types.NamespacedName *nodenetworkconfig.Client }
ScopedClient is provided to interface with a single configured NodeNetworkConfig.
func NewScopedClient ¶
func NewScopedClient(cli *nodenetworkconfig.Client, key types.NamespacedName) *ScopedClient
NewScopedClient returns a NodeNetworkConfig client scoped to a single NodeNetworkConfig.
func (*ScopedClient) Get ¶
func (sc *ScopedClient) Get(ctx context.Context) (*v1alpha.NodeNetworkConfig, error)
Get returns the NodeNetworkConfig that this scoped client is associated to.
func (*ScopedClient) PatchSpec ¶
func (sc *ScopedClient) PatchSpec(ctx context.Context, spec *v1alpha.NodeNetworkConfigSpec, fieldManager string) (*v1alpha.NodeNetworkConfig, error)
PatchSpec updates the associated NodeNetworkConfig with the passed NodeNetworkConfigSpec.