revision

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageRevision

func PackageRevision(pr v1beta1.PackageRevision) parser.BackendOption

PackageRevision sets the package revision for ImageBackend.

func SetupConfigurationRevision

func SetupConfigurationRevision(mgr ctrl.Manager, l logging.Logger, cache xpkg.Cache, namespace string) error

SetupConfigurationRevision adds a controller that reconciles ConfigurationRevisions.

func SetupProviderRevision

func SetupProviderRevision(mgr ctrl.Manager, l logging.Logger, cache xpkg.Cache, namespace string) error

SetupProviderRevision adds a controller that reconciles ProviderRevisions.

Types

type APIEstablisher

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

APIEstablisher establishes control or ownership of resources in the API server for a parent.

func NewAPIEstablisher

func NewAPIEstablisher(client client.Client) *APIEstablisher

NewAPIEstablisher creates a new APIEstablisher.

func (*APIEstablisher) Establish

func (e *APIEstablisher) Establish(ctx context.Context, objs []runtime.Object, parent resource.Object, control bool) ([]runtimev1alpha1.TypedReference, error)

Establish checks that control or ownership of resources can be established by parent, then establishes it.

type ConfigurationHooks

type ConfigurationHooks struct{}

ConfigurationHooks performs operations for a configuration package before and after the revision establishes objects.

func NewConfigurationHooks

func NewConfigurationHooks() *ConfigurationHooks

NewConfigurationHooks creates a new ConfigurationHook.

func (*ConfigurationHooks) Post

Post is a no op for configuration packages.

func (*ConfigurationHooks) Pre

Pre sets status fields based on the configuration package.

type Establisher

type Establisher interface {
	Establish(ctx context.Context, objects []runtime.Object, parent resource.Object, control bool) ([]runtimev1alpha1.TypedReference, error)
}

An Establisher establishes control or ownership of a set of resources in the API server by checking that control or ownership can be established for all resources and then establishing it.

type Hooks

type Hooks interface {
	// Pre performs operations meant to happen before establishing objects.
	Pre(context.Context, runtime.Object, v1beta1.PackageRevision) error

	// Post performs operations meant to happen after establishing objects.
	Post(context.Context, runtime.Object, v1beta1.PackageRevision) error
}

A Hooks performs operations before and after a revision establishes objects.

type ImageBackend

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

ImageBackend is a backend for parser.

func NewImageBackend

func NewImageBackend(cache xpkg.Cache, fetcher xpkg.Fetcher) *ImageBackend

NewImageBackend creates a new image backend.

func (*ImageBackend) Init

Init initializes an ImageBackend.

type NopHooks

type NopHooks struct{}

NopHooks performs no operations.

func NewNopHooks

func NewNopHooks() *NopHooks

NewNopHooks creates a hook that does nothing.

func (*NopHooks) Post

Post does nothing and returns nil.

func (*NopHooks) Pre

Pre does nothing and returns nil.

type ProviderHooks

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

ProviderHooks performs operations for a provider package that requires a controller before and after the revision establishes objects.

func NewProviderHooks

func NewProviderHooks(client resource.ClientApplicator, namespace string) *ProviderHooks

NewProviderHooks creates a new ProviderHooks.

func (*ProviderHooks) Post

Post creates a packaged provider controller and service account if the revision is active.

func (*ProviderHooks) Pre

Pre cleans up a packaged controller and service account if the revision is inactive.

type Reconciler

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

Reconciler reconciles packages.

func NewReconciler

func NewReconciler(mgr manager.Manager, opts ...ReconcilerOption) *Reconciler

NewReconciler creates a new package revision reconciler.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(req reconcile.Request) (reconcile.Result, error)

Reconcile package revision.

type ReconcilerOption

type ReconcilerOption func(*Reconciler)

ReconcilerOption is used to configure the Reconciler.

func WithCache

func WithCache(c xpkg.Cache) ReconcilerOption

WithCache specifies how the Reconcile should cache package contents.

func WithClientApplicator

func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption

WithClientApplicator specifies how the Reconciler should interact with the Kubernetes API.

func WithEstablisher

func WithEstablisher(e Establisher) ReconcilerOption

WithEstablisher specifies how the Reconciler should establish package resources.

func WithFinalizer

func WithFinalizer(f resource.Finalizer) ReconcilerOption

WithFinalizer specifies how the Reconciler should finalize package revisions.

func WithHooks

func WithHooks(h Hooks) ReconcilerOption

WithHooks specifies how the Reconciler should perform pre and post object establishment operations.

func WithLinter

func WithLinter(l parser.Linter) ReconcilerOption

WithLinter specifies how the Reconciler should parse a package.

func WithLogger

func WithLogger(log logging.Logger) ReconcilerOption

WithLogger specifies how the Reconciler should log messages.

func WithNewPackageRevisionFn

func WithNewPackageRevisionFn(f func() v1beta1.PackageRevision) ReconcilerOption

WithNewPackageRevisionFn determines the type of package being reconciled.

func WithParser

func WithParser(p parser.Parser) ReconcilerOption

WithParser specifies how the Reconciler should parse a package.

func WithParserBackend

func WithParserBackend(p parser.Backend) ReconcilerOption

WithParserBackend specifies how the Reconciler should parse a package.

func WithRecorder

func WithRecorder(er event.Recorder) ReconcilerOption

WithRecorder specifies how the Reconciler should record Kubernetes events.

func WithVersioner added in v0.14.0

func WithVersioner(v version.Operations) ReconcilerOption

WithVersioner specifies how the Reconciler should fetch the current Crossplane version.

Jump to

Keyboard shortcuts

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