controllers

package
v0.0.0-...-a9f80de Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	reconcile.Reconciler
	SetupWithManager(ctrl.Manager) error
}

Controller is the interface for all "reconcilers". It adds a consistent way to to register with managers

func ImageRepositoryCloudFormationController

func ImageRepositoryCloudFormationController(c sdk.Client) Controller

func PostgresCloudFormationController

func PostgresCloudFormationController(c sdk.Client) Controller

PostgresCloudFormationController creates a Controller instance for provision Postgres with cloudformation.

func PrincipalCloudFormationController

func PrincipalCloudFormationController(c sdk.Client) Controller

func RedisCloudFormationController

func RedisCloudFormationController(c sdk.Client) Controller

RedisCloudFormationController creates a Controller instance for provision an ElastiCache ReplicationGroup with cloudformation.

func S3CloudFormationController

func S3CloudFormationController(c sdk.Client) Controller

func SQSCloudFormationController

func SQSCloudFormationController(c sdk.Client) Controller

type ControllerWrapper

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

ControllerWrapper allows us to wrap a reconcile.Reconciler to collect and inspect any errors. This is useful for tests

Example:

myWrappedReconciler := &ControllerWrapper{
    Reconciler: &myReconcilerUnderTest{},
}

go myWrappeedReconciler.Reconcile(...) // Reconcile called aysync elsewhere

Consistently(myWrappedReconciler.Err, time.Second*2).ShouldNot(HaveOccurred())

func (*ControllerWrapper) Err

func (r *ControllerWrapper) Err() error

Err shifts the first error off the list of collected errors, returns it and flushes the error queue

func (*ControllerWrapper) Errs

func (r *ControllerWrapper) Errs() []error

Errs returns all errors collected and flushes the error queue

func (*ControllerWrapper) Reconcile

Reconcile forwards the Reconcile call to the real Controller and collects any errors

func (*ControllerWrapper) SetupWithManager

func (r *ControllerWrapper) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager emulates the SetupWithManager call

type ServiceAccountController

type ServiceAccountController struct {
	Scheme           *runtime.Scheme // Scheme is required for operations like gc
	Log              logr.Logger     // Log will be used to report each reconcile
	KubernetesClient client.Client   // KubernetesClient is required to talk to api
}

func (*ServiceAccountController) Reconcile

func (r *ServiceAccountController) Reconcile(req ctrl.Request) (res ctrl.Result, err error)

Reconcile synchronises state between the resource and a cloudformation stack

func (*ServiceAccountController) SetupWithManager

func (r *ServiceAccountController) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager validates and registers this controller with the manager and api

Jump to

Keyboard shortcuts

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