reconstitution

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(mgr ctrl.Manager, cache *Cache, rec Reconciler) error

New creates a new reconstitution controller, which is responsible for "reconstituting" resources i.e. allowing controllers to treat them as individual resources instead of their storage representation (ResourceSlice).

Types

type Cache added in v0.0.4

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

Cache maintains a fast index of (ResourceRef + Composition + Synthesis) -> Resource.

func NewCache added in v0.0.4

func NewCache(client client.Client) *Cache

func (*Cache) Get added in v0.0.4

func (c *Cache) Get(ctx context.Context, comp *SynthesisRef, ref *resource.Ref) (*Resource, bool)

func (*Cache) GetDefiningCRD added in v0.0.9

func (c *Cache) GetDefiningCRD(ctx context.Context, syn *SynthesisRef, gk schema.GroupKind) (*Resource, bool)

func (*Cache) RangeByReadinessGroup added in v0.0.7

func (c *Cache) RangeByReadinessGroup(ctx context.Context, comp *SynthesisRef, group int, dir RangeDirection) []*Resource

type Client

type Client interface {
	Get(ctx context.Context, syn *SynthesisRef, res *resource.Ref) (*resource.Resource, bool)
	RangeByReadinessGroup(ctx context.Context, syn *SynthesisRef, group int, dir RangeDirection) []*Resource
	GetDefiningCRD(ctx context.Context, syn *SynthesisRef, gk schema.GroupKind) (*Resource, bool)
}

Client provides read/write access to a collection of reconstituted resources.

type RangeDirection added in v0.0.7

type RangeDirection bool
var (
	RangeAsc  RangeDirection = true
	RangeDesc RangeDirection = false
)

type Reconciler

type Reconciler interface {
	Reconcile(ctx context.Context, req *Request) (ctrl.Result, error)
}

Reconciler is implemented by types that can reconcile individual, reconstituted resources.

type Request

type Request struct {
	Resource    resource.Ref
	Composition types.NamespacedName
}

Request is like controller-runtime reconcile.Request but for reconstituted resources. https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile#Request

type Resource

type Resource = resource.Resource

type SynthesisRef added in v0.0.6

type SynthesisRef struct {
	CompositionName, Namespace, UUID string
}

SynthesisRef refers to a specific synthesis of a composition.

func NewSynthesisRef added in v0.0.6

func NewSynthesisRef(comp *apiv1.Composition) *SynthesisRef

Jump to

Keyboard shortcuts

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