controllers

package
v0.0.0-...-608c54b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	// actionInit tells the controller to initialize the created Instance
	ActionInit Action = iota

	// actionUpdate tells the controller to update the Instance status
	ActionUpdate

	// actionCleanup tells the controller to remove the Instance
	// and all other resources owned by it
	ActionCleanup

	// actionIgnore tells the controller to do nothing and ignore the request
	ActionIgnore
)

type Decider

type Decider struct {
	Client client.Client
}

func (*Decider) Decide

func (d *Decider) Decide(ctx context.Context, instance instancev1.Instance, req ctrl.Request) (Action, error)

decide decides based on the instance annotations, status and owned resource(s) what the controller needs to to do.

type InstanceReconciler

type InstanceReconciler struct {
	client.Client
	Log     logr.Logger
	Scheme  *runtime.Scheme
	Decider Decider
}

InstanceReconciler reconciles a Instance object

func (*InstanceReconciler) Reconcile

func (r *InstanceReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

+kubebuilder:rbac:groups=instance.cow.network,resources=instances,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=instance.cow.network,resources=instances/status,verbs=get;update;patch +kubebuilder:rbac:groups=batch,resources=instances,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=batch,resources=instances/status,verbs=get

func (*InstanceReconciler) SetupWithManager

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

Jump to

Keyboard shortcuts

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