reconstitution

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 14 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 *CompositionRef, ref *resource.Ref) (*Resource, bool)

type Client

type Client interface {
	Get(ctx context.Context, comp *CompositionRef, res *resource.Ref) (*resource.Resource, bool)
}

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

type CompositionRef

type CompositionRef struct {
	Name, Namespace string
	Generation      int64
}

CompositionRef refers to a specific generation of a composition.

func NewCompositionRef

func NewCompositionRef(comp *apiv1.Composition) *CompositionRef

type ManifestRef

type ManifestRef struct {
	Slice types.NamespacedName
	Index int // position of this manifest within the slice
}

ManifestRef references a particular resource manifest within a resource slice.

func (*ManifestRef) FindStatus added in v0.0.2

func (m *ManifestRef) FindStatus(slice *apiv1.ResourceSlice) *apiv1.ResourceState

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
	Manifest    ManifestRef
	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

Jump to

Keyboard shortcuts

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