nn

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(mgr ctrl.Manager, l logging.Logger, namespace string) error

Setup adds a controller that reconciles the Lock.

Types

type Credentials

type Credentials struct {
	Username string
	Password string
}

Credentials holds the information for authenticating with the Server.

type DeviceDriverHooks

type DeviceDriverHooks struct {
	// contains filtered or unexported fields
}

DeviceDriverHooks performs operations to deploy the device driver.

func NewDeviceDriverHooks

func NewDeviceDriverHooks(client resource.ClientApplicator, log logging.Logger, namespace string) *DeviceDriverHooks

NewPDeviceDriverHooks creates a new DeviceDriverHooks.

func (*DeviceDriverHooks) Deploy

Deploy performs operations to deploy the device driver for the network node

func (*DeviceDriverHooks) Destroy

Destroy performs operations to destroy the device driver for the network node

type EnqueueRequestForAllDeviceDriversWithRequests

type EnqueueRequestForAllDeviceDriversWithRequests struct {
	// contains filtered or unexported fields
}

func (*EnqueueRequestForAllDeviceDriversWithRequests) Create

Create enqueues a request for all network nodes which pertains to the Device Driver.

func (*EnqueueRequestForAllDeviceDriversWithRequests) Delete

Delete enqueues a request for all network nodes which pertains to the Device Driver.

func (*EnqueueRequestForAllDeviceDriversWithRequests) Generic

Generic enqueues a request for all network nodes which pertains to the Device Driver.

func (*EnqueueRequestForAllDeviceDriversWithRequests) Update

Update enqueues a request for all network nodes which pertains to the Device Driver.

type Hooks

type Hooks interface {
	// Deploy performs operations to deploy the device driver for the network node
	Deploy(ctx context.Context, nn ndddvrv1.Nn, c *corev1.Container) error

	// Destroy performs operations to destroy the device driver for the network node
	Destroy(ctx context.Context, nn ndddvrv1.Nn, c *corev1.Container) error
}

A Hooks performs operations to deploy the device driver for the network node.

type NnValidator

type NnValidator struct {
	// contains filtered or unexported fields
}

func NewNnValidator

func NewNnValidator(client resource.ClientApplicator, log logging.Logger) *NnValidator

func (*NnValidator) GetSecret

func (v *NnValidator) GetSecret(ctx context.Context, namespace, credentialsName string) (credsSecret *corev1.Secret, err error)

Retrieve the secret containing the credentials for talking to the Network Node.

func (*NnValidator) ValidateCredentials

func (v *NnValidator) ValidateCredentials(ctx context.Context, namespace, credentialsName, targetAddress string) (creds *Credentials, err error)

func (*NnValidator) ValidateDeviceDriver

func (v *NnValidator) ValidateDeviceDriver(ctx context.Context, namespace, name, kind string, port int) (c *corev1.Container, err error)

type NopHooks

type NopHooks struct{}

NopHooks performs no operations.

func NewNopHooks

func NewNopHooks() *NopHooks

NewNopHooks creates a hook that does nothing.

func (*NopHooks) Deploy

func (h *NopHooks) Deploy(ctx context.Context, nn ndddvrv1.Nn, c *corev1.Container) error

Deploy does nothing and returns nil.

func (*NopHooks) Destroy

func (h *NopHooks) Destroy(ctx context.Context, nn ndddvrv1.Nn, c *corev1.Container) error

Destroy does nothing and returns nil.

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler reconciles packages.

func NewReconciler

func NewReconciler(mgr manager.Manager, opts ...ReconcilerOption) *Reconciler

NewReconciler creates a new package revision reconciler.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

Reconcile network node.

type ReconcilerOption

type ReconcilerOption func(*Reconciler)

ReconcilerOption is used to configure the Reconciler.

func WithHooks

func WithHooks(h Hooks) ReconcilerOption

WithHooks specifies how the Reconciler should deploy a device driver

func WithLogger

func WithLogger(log logging.Logger) ReconcilerOption

WithLogger specifies how the Reconciler should log messages.

func WithNewNetworkNodeFn

func WithNewNetworkNodeFn(f func() ndddvrv1.Nn) ReconcilerOption

WithNewNetworkNodeFn determines the type of network node being reconciled.

func WithRecorder

func WithRecorder(er event.Recorder) ReconcilerOption

WithRecorder specifies how the Reconciler should record Kubernetes events.

func WithValidator

func WithValidator(v Validator) ReconcilerOption

WithValidator specifies how the Reconciler should perform object validation.

type Validator

type Validator interface {
	// Validates the credentials
	ValidateCredentials(ctx context.Context, namespace, credentialsName, targetAddress string) (*Credentials, error)

	// Validates the device driver
	ValidateDeviceDriver(ctx context.Context, namespace, name, kind string, port int) (*corev1.Container, error)
}

A Creds validates the validaty of various resources.

Jump to

Keyboard shortcuts

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