networknode

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 22 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 APIEstablisher

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

APIEstablisher establishes control or ownership of resources in the API server for a parent.

func NewAPIEstablisher

func NewAPIEstablisher(client resource.ClientApplicator, log logging.Logger, namespace string) *APIEstablisher

NewAPIEstablisher creates a new APIEstablisher.

func (*APIEstablisher) Create

func (e *APIEstablisher) Create(ctx context.Context, name string, port int, c *corev1.Container) error

Create creates a set of resources

func (*APIEstablisher) Delete

func (e *APIEstablisher) Delete(ctx context.Context, name string) error

Delete deletes a set of resources

func (*APIEstablisher) Update

func (e *APIEstablisher) Update(ctx context.Context, name string, port int, c *corev1.Container) error

Update updates a set of resources

type Credentials

type Credentials struct {
	Username string
	Password string
}

Credentials holds the information for authenticating with the Server.

type Establisher

type Establisher interface {
	// Create brings up resources
	Create(ctx context.Context, name string, port int, c *corev1.Container) error

	// Update brings up resources
	Update(ctx context.Context, name string, port int, c *corev1.Container) error

	// Delete brings down resources
	Delete(ctx context.Context, name string) error
}

An Establisher brings up or down a set of resources in the API server

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 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) DeviceDriverMapFunc

func (r *Reconciler) DeviceDriverMapFunc(o client.Object) []ctrl.Request

DeviceDriverMapFunc is a handler.ToRequestsFunc to be used to enqeue request for reconciliation of NetworkNode when the device driver object changes

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 WithEstablisher

func WithEstablisher(er *APIEstablisher) ReconcilerOption

WithEstablisher specifies how the reconciler should create/delete/update resources through the k8s api

func WithLogger

func WithLogger(log logging.Logger) ReconcilerOption

WithLogger specifies how the Reconciler should log messages.

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