Documentation ¶
Overview ¶
Package revision implements the Crossplane Package Revision controllers.
Index ¶
- func GetPackageOwnerReference(rev resource.Object) (metav1.OwnerReference, bool)
- func PackageRevision(pr v1.PackageRevision) parser.BackendOption
- func SetupConfigurationRevision(mgr ctrl.Manager, o controller.Options) error
- func SetupProviderRevision(mgr ctrl.Manager, o controller.Options) error
- type APIEstablisher
- type ConfigurationHooks
- type DependencyManager
- type EnqueueRequestForReferencingProviderRevisions
- func (e *EnqueueRequestForReferencingProviderRevisions) Create(ctx context.Context, evt event.CreateEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForReferencingProviderRevisions) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForReferencingProviderRevisions) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForReferencingProviderRevisions) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.RateLimitingInterface)
- type Establisher
- type Hooks
- type ImageBackend
- type ImageBackendOption
- type NopEstablisher
- type NopHooks
- type PackageDependencyManager
- type ProviderHooks
- type Reconciler
- type ReconcilerOption
- func WithCache(c xpkg.PackageCache) ReconcilerOption
- func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption
- func WithDependencyManager(m DependencyManager) ReconcilerOption
- func WithEstablisher(e Establisher) ReconcilerOption
- func WithFinalizer(f resource.Finalizer) ReconcilerOption
- func WithHooks(h Hooks) ReconcilerOption
- func WithLinter(l parser.Linter) ReconcilerOption
- func WithLogger(log logging.Logger) ReconcilerOption
- func WithNewPackageRevisionFn(f func() v1.PackageRevision) ReconcilerOption
- func WithParser(p parser.Parser) ReconcilerOption
- func WithParserBackend(p parser.Backend) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
- func WithVersioner(v version.Operations) ReconcilerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPackageOwnerReference ¶ added in v1.5.0
func GetPackageOwnerReference(rev resource.Object) (metav1.OwnerReference, bool)
GetPackageOwnerReference returns the owner reference that points to the owner package of given revision, if it can find one.
func PackageRevision ¶
func PackageRevision(pr v1.PackageRevision) parser.BackendOption
PackageRevision sets the package revision for ImageBackend.
func SetupConfigurationRevision ¶
func SetupConfigurationRevision(mgr ctrl.Manager, o controller.Options) error
SetupConfigurationRevision adds a controller that reconciles ConfigurationRevisions.
func SetupProviderRevision ¶
func SetupProviderRevision(mgr ctrl.Manager, o controller.Options) 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, namespace string) *APIEstablisher
NewAPIEstablisher creates a new APIEstablisher.
func (*APIEstablisher) Establish ¶
func (e *APIEstablisher) Establish(ctx context.Context, objs []runtime.Object, parent v1.PackageRevision, control bool) ([]xpv1.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 ¶
func (h *ConfigurationHooks) Post(context.Context, runtime.Object, v1.PackageRevision) error
Post is a no op for configuration packages.
func (*ConfigurationHooks) Pre ¶
func (h *ConfigurationHooks) Pre(_ context.Context, _ runtime.Object, _ v1.PackageRevision) error
Pre sets status fields based on the configuration package.
type DependencyManager ¶
type DependencyManager interface { Resolve(ctx context.Context, pkg runtime.Object, pr v1.PackageRevision) (found, installed, invalid int, err error) RemoveSelf(ctx context.Context, pr v1.PackageRevision) error }
DependencyManager is a lock on packages.
type EnqueueRequestForReferencingProviderRevisions ¶ added in v1.1.4
type EnqueueRequestForReferencingProviderRevisions struct {
// contains filtered or unexported fields
}
EnqueueRequestForReferencingProviderRevisions enqueues a request for all provider revisions that reference a ControllerConfig when the given ControllerConfig changes.
func (*EnqueueRequestForReferencingProviderRevisions) Create ¶ added in v1.1.4
func (e *EnqueueRequestForReferencingProviderRevisions) Create(ctx context.Context, evt event.CreateEvent, q workqueue.RateLimitingInterface)
Create enqueues a request for all provider revisions that reference a given ControllerConfig.
func (*EnqueueRequestForReferencingProviderRevisions) Delete ¶ added in v1.1.4
func (e *EnqueueRequestForReferencingProviderRevisions) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface)
Delete enqueues a request for all provider revisions that reference a given ControllerConfig.
func (*EnqueueRequestForReferencingProviderRevisions) Generic ¶ added in v1.1.4
func (e *EnqueueRequestForReferencingProviderRevisions) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.RateLimitingInterface)
Generic enqueues a request for all provider revisions that reference a given ControllerConfig.
func (*EnqueueRequestForReferencingProviderRevisions) Update ¶ added in v1.1.4
func (e *EnqueueRequestForReferencingProviderRevisions) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.RateLimitingInterface)
Update enqueues a request for all provider revisions that reference a given ControllerConfig.
type Establisher ¶
type Establisher interface {
Establish(ctx context.Context, objects []runtime.Object, parent v1.PackageRevision, control bool) ([]xpv1.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, v1.PackageRevision) error // Post performs operations meant to happen after establishing objects. Post(context.Context, runtime.Object, v1.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(fetcher xpkg.Fetcher, opts ...ImageBackendOption) *ImageBackend
NewImageBackend creates a new image backend.
func (*ImageBackend) Init ¶
func (i *ImageBackend) Init(ctx context.Context, bo ...parser.BackendOption) (io.ReadCloser, error)
Init initializes an ImageBackend.
type ImageBackendOption ¶ added in v1.4.0
type ImageBackendOption func(i *ImageBackend)
An ImageBackendOption sets configuration for an image backend.
func WithDefaultRegistry ¶ added in v1.4.0
func WithDefaultRegistry(registry string) ImageBackendOption
WithDefaultRegistry sets the default registry that an image backend will use.
type NopEstablisher ¶ added in v1.7.0
type NopEstablisher struct{}
NopEstablisher does nothing.
func NewNopEstablisher ¶ added in v1.7.0
func NewNopEstablisher() *NopEstablisher
NewNopEstablisher returns a new NopEstablisher.
func (*NopEstablisher) Establish ¶ added in v1.7.0
func (*NopEstablisher) Establish(_ context.Context, _ []runtime.Object, _ v1.PackageRevision, _ bool) ([]xpv1.TypedReference, error)
Establish does nothing.
type NopHooks ¶
type NopHooks struct{}
NopHooks performs no operations.
type PackageDependencyManager ¶
type PackageDependencyManager struct {
// contains filtered or unexported fields
}
PackageDependencyManager is a resolver for packages.
func NewPackageDependencyManager ¶
func NewPackageDependencyManager(c client.Client, nd dag.NewDAGFn, t v1beta1.PackageType) *PackageDependencyManager
NewPackageDependencyManager creates a new PackageDependencyManager.
func (*PackageDependencyManager) RemoveSelf ¶
func (m *PackageDependencyManager) RemoveSelf(ctx context.Context, pr v1.PackageRevision) error
RemoveSelf removes a package from the lock.
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, serviceAccount string) *ProviderHooks
NewProviderHooks creates a new ProviderHooks.
func (*ProviderHooks) Post ¶
func (h *ProviderHooks) Post(ctx context.Context, pkg runtime.Object, pr v1.PackageRevision) error
Post creates a packaged provider controller and service account if the revision is active.
func (*ProviderHooks) Pre ¶
func (h *ProviderHooks) Pre(ctx context.Context, pkg runtime.Object, pr v1.PackageRevision) error
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.
type ReconcilerOption ¶
type ReconcilerOption func(*Reconciler)
ReconcilerOption is used to configure the Reconciler.
func WithCache ¶
func WithCache(c xpkg.PackageCache) 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 WithDependencyManager ¶
func WithDependencyManager(m DependencyManager) ReconcilerOption
WithDependencyManager specifies how the Reconciler should manage dependencies.
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 lint a package.
func WithLogger ¶
func WithLogger(log logging.Logger) ReconcilerOption
WithLogger specifies how the Reconciler should log messages.
func WithNewPackageRevisionFn ¶
func WithNewPackageRevisionFn(f func() v1.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 ¶
func WithVersioner(v version.Operations) ReconcilerOption
WithVersioner specifies how the Reconciler should fetch the current Crossplane version.