controllers

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 7 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 {
	// ReconcileNode reconciles the state of the resource.
	ReconcileNode(ctx context.Context, node *yaml.RNode) error
}

type Registry

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

Registry is a registry of all the controllers. It is used to map a kind to the controller that can handle that kind. We need to avoid circular dependencies. So controller registration happens in app.SetupRegistry. The app package can then import

  1. Any package which defines a controller
  2. The controller package itself

The controller package shouldn't import any controller packages as that would risk circular dependencies Controllers that need to apply other resources can import the registry in order to loop up the controller for the resource

func (*Registry) GetController

func (r *Registry) GetController(gvk schema.GroupVersionKind) (Controller, error)

func (*Registry) ReconcileNode

func (r *Registry) ReconcileNode(ctx context.Context, n *yaml.RNode) error

func (*Registry) Register

func (r *Registry) Register(gvk schema.GroupVersionKind, controller Controller) error

Jump to

Keyboard shortcuts

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