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 SetupFunctionRevision(mgr ctrl.Manager, o controller.Options) error
- func SetupProviderRevision(mgr ctrl.Manager, o controller.Options) error
- type APIEstablisher
- type DependencyManager
- type DeploymentOverride
- func DeploymentForControllerConfig(cc *v1alpha1.ControllerConfig) DeploymentOverride
- func DeploymentRuntimeWithAdditionalEnvironments(env []corev1.EnvVar) DeploymentOverride
- func DeploymentRuntimeWithAdditionalPorts(ports []corev1.ContainerPort) DeploymentOverride
- func DeploymentRuntimeWithImagePullPolicy(policy corev1.PullPolicy) DeploymentOverride
- func DeploymentRuntimeWithOptionalImage(image string) DeploymentOverride
- func DeploymentRuntimeWithOptionalImagePullPolicy(policy corev1.PullPolicy) DeploymentOverride
- func DeploymentRuntimeWithOptionalSecurityContext(securityContext *corev1.SecurityContext) DeploymentOverride
- func DeploymentRuntimeWithTLSClientSecret(secret string) DeploymentOverride
- func DeploymentRuntimeWithTLSServerSecret(secret string) DeploymentOverride
- func DeploymentWithImagePullSecrets(secrets []corev1.LocalObjectReference) DeploymentOverride
- func DeploymentWithNamespace(namespace string) DeploymentOverride
- func DeploymentWithOptionalName(name string) DeploymentOverride
- func DeploymentWithOptionalPodSecurityContext(podSecurityContext *corev1.PodSecurityContext) DeploymentOverride
- func DeploymentWithOptionalReplicas(replicas int32) DeploymentOverride
- func DeploymentWithOptionalServiceAccount(sa string) DeploymentOverride
- func DeploymentWithOwnerReferences(owners []metav1.OwnerReference) DeploymentOverride
- func DeploymentWithRuntimeContainer() DeploymentOverride
- func DeploymentWithSelectors(selectors map[string]string) DeploymentOverride
- type EnqueueRequestForReferencingFunctionRevisions
- func (e *EnqueueRequestForReferencingFunctionRevisions) Create(ctx context.Context, evt event.CreateEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForReferencingFunctionRevisions) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForReferencingFunctionRevisions) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForReferencingFunctionRevisions) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.RateLimitingInterface)
- 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 FunctionHooks
- func (h *FunctionHooks) Deactivate(ctx context.Context, _ v1.PackageRevisionWithRuntime, build ManifestBuilder) error
- func (h *FunctionHooks) Post(ctx context.Context, pkg runtime.Object, pr v1.PackageRevisionWithRuntime, ...) error
- func (h *FunctionHooks) Pre(ctx context.Context, _ runtime.Object, pr v1.PackageRevisionWithRuntime, ...) error
- type ImageBackend
- type ImageBackendOption
- type ManifestBuilder
- type NopEstablisher
- type PackageDependencyManager
- type ProviderHooks
- func (h *ProviderHooks) Deactivate(ctx context.Context, pr v1.PackageRevisionWithRuntime, build ManifestBuilder) error
- func (h *ProviderHooks) Post(ctx context.Context, pkg runtime.Object, pr v1.PackageRevisionWithRuntime, ...) error
- func (h *ProviderHooks) Pre(ctx context.Context, pkg runtime.Object, pr v1.PackageRevisionWithRuntime, ...) error
- 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 WithFeatureFlags(f *feature.Flags) ReconcilerOption
- func WithFinalizer(f resource.Finalizer) ReconcilerOption
- func WithLinter(l parser.Linter) ReconcilerOption
- func WithLogger(log logging.Logger) ReconcilerOption
- func WithNamespace(n string) 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 WithRuntimeHooks(h RuntimeHooks) ReconcilerOption
- func WithServiceAccount(sa string) ReconcilerOption
- func WithVersioner(v version.Operations) ReconcilerOption
- type RuntimeHooks
- type RuntimeManifestBuilder
- func (b *RuntimeManifestBuilder) Deployment(serviceAccount string, overrides ...DeploymentOverride) *appsv1.Deployment
- func (b *RuntimeManifestBuilder) Service(overrides ...ServiceOverride) *corev1.Service
- func (b *RuntimeManifestBuilder) ServiceAccount(overrides ...ServiceAccountOverride) *corev1.ServiceAccount
- func (b *RuntimeManifestBuilder) TLSClientSecret() *corev1.Secret
- func (b *RuntimeManifestBuilder) TLSServerSecret() *corev1.Secret
- type RuntimeManifestBuilderOption
- func RuntimeManifestBuilderWithControllerConfig(cc *v1alpha1.ControllerConfig) RuntimeManifestBuilderOption
- func RuntimeManifestBuilderWithRuntimeConfig(rc *v1beta1.DeploymentRuntimeConfig) RuntimeManifestBuilderOption
- func RuntimeManifestBuilderWithServiceAccountPullSecrets(secrets []corev1.LocalObjectReference) RuntimeManifestBuilderOption
- type ServiceAccountOverride
- func ServiceAccountWithAdditionalPullSecrets(secrets []corev1.LocalObjectReference) ServiceAccountOverride
- func ServiceAccountWithControllerConfig(cc *v1alpha1.ControllerConfig) ServiceAccountOverride
- func ServiceAccountWithNamespace(namespace string) ServiceAccountOverride
- func ServiceAccountWithOptionalName(name string) ServiceAccountOverride
- func ServiceAccountWithOwnerReferences(owners []metav1.OwnerReference) ServiceAccountOverride
- type ServiceOverride
- func ServiceWithAdditionalPorts(ports []corev1.ServicePort) ServiceOverride
- func ServiceWithClusterIP(clusterIP string) ServiceOverride
- func ServiceWithName(name string) ServiceOverride
- func ServiceWithNamespace(namespace string) ServiceOverride
- func ServiceWithOptionalName(name string) ServiceOverride
- func ServiceWithOwnerReferences(owners []metav1.OwnerReference) ServiceOverride
- func ServiceWithSelectors(selectors map[string]string) ServiceOverride
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 SetupFunctionRevision ¶ added in v1.14.0
func SetupFunctionRevision(mgr ctrl.Manager, o controller.Options) error
SetupFunctionRevision adds a controller that reconciles FunctionRevisions.
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.
func (*APIEstablisher) ReleaseObjects ¶ added in v1.14.0
func (e *APIEstablisher) ReleaseObjects(ctx context.Context, parent v1.PackageRevision) error
ReleaseObjects removes control of owned resources in the API server for a package revision.
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 DeploymentOverride ¶ added in v1.14.0
type DeploymentOverride func(deployment *appsv1.Deployment)
DeploymentOverride is a modifier option that overrides a Deployment.
func DeploymentForControllerConfig ¶ added in v1.14.0
func DeploymentForControllerConfig(cc *v1alpha1.ControllerConfig) DeploymentOverride
DeploymentForControllerConfig overrides the deployment with the values defined in the ControllerConfig.
func DeploymentRuntimeWithAdditionalEnvironments ¶ added in v1.14.0
func DeploymentRuntimeWithAdditionalEnvironments(env []corev1.EnvVar) DeploymentOverride
DeploymentRuntimeWithAdditionalEnvironments adds additional environment variables to the runtime container of a Deployment.
func DeploymentRuntimeWithAdditionalPorts ¶ added in v1.14.0
func DeploymentRuntimeWithAdditionalPorts(ports []corev1.ContainerPort) DeploymentOverride
DeploymentRuntimeWithAdditionalPorts adds additional ports to the runtime container of a Deployment.
func DeploymentRuntimeWithImagePullPolicy ¶ added in v1.14.0
func DeploymentRuntimeWithImagePullPolicy(policy corev1.PullPolicy) DeploymentOverride
DeploymentRuntimeWithImagePullPolicy overrides the image pull policy of the runtime container of a Deployment.
func DeploymentRuntimeWithOptionalImage ¶ added in v1.14.0
func DeploymentRuntimeWithOptionalImage(image string) DeploymentOverride
DeploymentRuntimeWithOptionalImage set the image for the runtime container if it is unset, e.g. not specified in the DeploymentRuntimeConfig.
func DeploymentRuntimeWithOptionalImagePullPolicy ¶ added in v1.14.0
func DeploymentRuntimeWithOptionalImagePullPolicy(policy corev1.PullPolicy) DeploymentOverride
DeploymentRuntimeWithOptionalImagePullPolicy set the image pull policy if it is unset.
func DeploymentRuntimeWithOptionalSecurityContext ¶ added in v1.14.0
func DeploymentRuntimeWithOptionalSecurityContext(securityContext *corev1.SecurityContext) DeploymentOverride
DeploymentRuntimeWithOptionalSecurityContext sets the security context of the runtime container if it is unset.
func DeploymentRuntimeWithTLSClientSecret ¶ added in v1.14.0
func DeploymentRuntimeWithTLSClientSecret(secret string) DeploymentOverride
DeploymentRuntimeWithTLSClientSecret mounts a TLS Client secret as a volume and sets the path of the mounted volume as an environment variable of the runtime container of a Deployment.
func DeploymentRuntimeWithTLSServerSecret ¶ added in v1.14.0
func DeploymentRuntimeWithTLSServerSecret(secret string) DeploymentOverride
DeploymentRuntimeWithTLSServerSecret mounts a TLS Server secret as a volume and sets the path of the mounted volume as an environment variable of the runtime container of a Deployment.
func DeploymentWithImagePullSecrets ¶ added in v1.14.0
func DeploymentWithImagePullSecrets(secrets []corev1.LocalObjectReference) DeploymentOverride
DeploymentWithImagePullSecrets overrides the image pull secrets of a Deployment.
func DeploymentWithNamespace ¶ added in v1.14.0
func DeploymentWithNamespace(namespace string) DeploymentOverride
DeploymentWithNamespace overrides the namespace of a Deployment.
func DeploymentWithOptionalName ¶ added in v1.14.0
func DeploymentWithOptionalName(name string) DeploymentOverride
DeploymentWithOptionalName overrides the name of a Deployment if empty.
func DeploymentWithOptionalPodSecurityContext ¶ added in v1.14.0
func DeploymentWithOptionalPodSecurityContext(podSecurityContext *corev1.PodSecurityContext) DeploymentOverride
DeploymentWithOptionalPodSecurityContext sets the pod security context if it is unset.
func DeploymentWithOptionalReplicas ¶ added in v1.14.0
func DeploymentWithOptionalReplicas(replicas int32) DeploymentOverride
DeploymentWithOptionalReplicas set the replicas if it is unset.
func DeploymentWithOptionalServiceAccount ¶ added in v1.14.0
func DeploymentWithOptionalServiceAccount(sa string) DeploymentOverride
DeploymentWithOptionalServiceAccount overrides the service account of a Deployment.
func DeploymentWithOwnerReferences ¶ added in v1.14.0
func DeploymentWithOwnerReferences(owners []metav1.OwnerReference) DeploymentOverride
DeploymentWithOwnerReferences overrides the owner references of a Deployment.
func DeploymentWithRuntimeContainer ¶ added in v1.14.0
func DeploymentWithRuntimeContainer() DeploymentOverride
DeploymentWithRuntimeContainer ensures that the runtime container exists and is the first container.
func DeploymentWithSelectors ¶ added in v1.14.0
func DeploymentWithSelectors(selectors map[string]string) DeploymentOverride
DeploymentWithSelectors overrides the selectors of a Deployment. It also ensures that the pod template labels always contains the deployment selector.
type EnqueueRequestForReferencingFunctionRevisions ¶ added in v1.14.0
type EnqueueRequestForReferencingFunctionRevisions struct {
// contains filtered or unexported fields
}
EnqueueRequestForReferencingFunctionRevisions enqueues a request for all function revisions that reference a ControllerConfig when the given ControllerConfig changes.
func (*EnqueueRequestForReferencingFunctionRevisions) Create ¶ added in v1.14.0
func (e *EnqueueRequestForReferencingFunctionRevisions) Create(ctx context.Context, evt event.CreateEvent, q workqueue.RateLimitingInterface)
Create enqueues a request for all function revisions that reference a given ControllerConfig.
func (*EnqueueRequestForReferencingFunctionRevisions) Delete ¶ added in v1.14.0
func (e *EnqueueRequestForReferencingFunctionRevisions) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface)
Delete enqueues a request for all function revisions that reference a given ControllerConfig.
func (*EnqueueRequestForReferencingFunctionRevisions) Generic ¶ added in v1.14.0
func (e *EnqueueRequestForReferencingFunctionRevisions) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.RateLimitingInterface)
Generic enqueues a request for all function revisions that reference a given ControllerConfig.
func (*EnqueueRequestForReferencingFunctionRevisions) Update ¶ added in v1.14.0
func (e *EnqueueRequestForReferencingFunctionRevisions) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.RateLimitingInterface)
Update enqueues a request for all function revisions that reference a given ControllerConfig.
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) ReleaseObjects(ctx context.Context, parent v1.PackageRevision) 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 FunctionHooks ¶ added in v1.14.0
type FunctionHooks struct {
// contains filtered or unexported fields
}
FunctionHooks performs runtime operations for function packages.
func NewFunctionHooks ¶ added in v1.14.0
func NewFunctionHooks(client client.Client) *FunctionHooks
NewFunctionHooks returns a new FunctionHooks.
func (*FunctionHooks) Deactivate ¶ added in v1.14.0
func (h *FunctionHooks) Deactivate(ctx context.Context, _ v1.PackageRevisionWithRuntime, build ManifestBuilder) error
Deactivate performs operations meant to happen before deactivating a revision.
func (*FunctionHooks) Post ¶ added in v1.14.0
func (h *FunctionHooks) Post(ctx context.Context, pkg runtime.Object, pr v1.PackageRevisionWithRuntime, build ManifestBuilder) error
Post performs operations meant to happen after establishing objects.
func (*FunctionHooks) Pre ¶ added in v1.14.0
func (h *FunctionHooks) Pre(ctx context.Context, _ runtime.Object, pr v1.PackageRevisionWithRuntime, build ManifestBuilder) error
Pre performs operations meant to happen before establishing 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 ManifestBuilder ¶ added in v1.14.0
type ManifestBuilder interface { // ServiceAccount builds and returns the service account manifest. ServiceAccount(overrides ...ServiceAccountOverride) *corev1.ServiceAccount // Deployment builds and returns the deployment manifest. Deployment(serviceAccount string, overrides ...DeploymentOverride) *appsv1.Deployment // Service builds and returns the service manifest. Service(overrides ...ServiceOverride) *corev1.Service // TLSClientSecret builds and returns the TLS client secret manifest. TLSClientSecret() *corev1.Secret // TLSServerSecret builds and returns the TLS server secret manifest. TLSServerSecret() *corev1.Secret }
ManifestBuilder builds the runtime manifests for a package revision.
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.
func (*NopEstablisher) ReleaseObjects ¶ added in v1.14.0
func (*NopEstablisher) ReleaseObjects(_ context.Context, _ v1.PackageRevision) error
ReleaseObjects does nothing.
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 runtime operations for provider packages.
func NewProviderHooks ¶
func NewProviderHooks(client client.Client) *ProviderHooks
NewProviderHooks returns a new ProviderHooks.
func (*ProviderHooks) Deactivate ¶ added in v1.14.0
func (h *ProviderHooks) Deactivate(ctx context.Context, pr v1.PackageRevisionWithRuntime, build ManifestBuilder) error
Deactivate performs operations meant to happen before deactivating a revision.
func (*ProviderHooks) Post ¶
func (h *ProviderHooks) Post(ctx context.Context, pkg runtime.Object, pr v1.PackageRevisionWithRuntime, build ManifestBuilder) error
Post performs operations meant to happen after establishing objects.
func (*ProviderHooks) Pre ¶
func (h *ProviderHooks) Pre(ctx context.Context, pkg runtime.Object, pr v1.PackageRevisionWithRuntime, build ManifestBuilder) error
Pre performs operations meant to happen before establishing objects.
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 WithFeatureFlags ¶ added in v1.14.0
func WithFeatureFlags(f *feature.Flags) ReconcilerOption
WithFeatureFlags specifies the feature flags to inject into the Reconciler.
func WithFinalizer ¶
func WithFinalizer(f resource.Finalizer) ReconcilerOption
WithFinalizer specifies how the Reconciler should finalize package revisions.
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 WithNamespace ¶ added in v1.14.0
func WithNamespace(n string) ReconcilerOption
WithNamespace specifies the namespace in which the Reconciler should create runtime resources.
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 WithRuntimeHooks ¶ added in v1.14.0
func WithRuntimeHooks(h RuntimeHooks) ReconcilerOption
WithRuntimeHooks specifies how the Reconciler should perform preparations (pre- and post-establishment) and cleanup (deactivate) for package runtime. The hooks are only used when the package has a runtime and the runtime is configured as Deployment.
func WithServiceAccount ¶ added in v1.14.0
func WithServiceAccount(sa string) ReconcilerOption
WithServiceAccount specifies the core Crossplane ServiceAccount name.
func WithVersioner ¶
func WithVersioner(v version.Operations) ReconcilerOption
WithVersioner specifies how the Reconciler should fetch the current Crossplane version.
type RuntimeHooks ¶ added in v1.14.0
type RuntimeHooks interface { // Pre performs operations meant to happen before establishing objects. Pre(context.Context, runtime.Object, v1.PackageRevisionWithRuntime, ManifestBuilder) error // Post performs operations meant to happen after establishing objects. Post(context.Context, runtime.Object, v1.PackageRevisionWithRuntime, ManifestBuilder) error // Deactivate performs operations meant to happen before deactivating a revision. Deactivate(context.Context, v1.PackageRevisionWithRuntime, ManifestBuilder) error }
A RuntimeHooks performs runtime operations before and after a revision establishes objects.
type RuntimeManifestBuilder ¶ added in v1.14.0
type RuntimeManifestBuilder struct {
// contains filtered or unexported fields
}
RuntimeManifestBuilder builds the runtime manifests for a package revision.
func NewRuntimeManifestBuilder ¶ added in v1.14.0
func NewRuntimeManifestBuilder(pwr v1.PackageRevisionWithRuntime, namespace string, opts ...RuntimeManifestBuilderOption) *RuntimeManifestBuilder
NewRuntimeManifestBuilder returns a new RuntimeManifestBuilder.
func (*RuntimeManifestBuilder) Deployment ¶ added in v1.14.0
func (b *RuntimeManifestBuilder) Deployment(serviceAccount string, overrides ...DeploymentOverride) *appsv1.Deployment
Deployment builds and returns the Deployment manifest.
func (*RuntimeManifestBuilder) Service ¶ added in v1.14.0
func (b *RuntimeManifestBuilder) Service(overrides ...ServiceOverride) *corev1.Service
Service builds and returns the Service manifest.
func (*RuntimeManifestBuilder) ServiceAccount ¶ added in v1.14.0
func (b *RuntimeManifestBuilder) ServiceAccount(overrides ...ServiceAccountOverride) *corev1.ServiceAccount
ServiceAccount builds and returns the ServiceAccount manifest.
func (*RuntimeManifestBuilder) TLSClientSecret ¶ added in v1.14.0
func (b *RuntimeManifestBuilder) TLSClientSecret() *corev1.Secret
TLSClientSecret builds and returns the Secret manifest for the TLS client certificate.
func (*RuntimeManifestBuilder) TLSServerSecret ¶ added in v1.14.0
func (b *RuntimeManifestBuilder) TLSServerSecret() *corev1.Secret
TLSServerSecret builds and returns the Secret manifest for the TLS server certificate.
type RuntimeManifestBuilderOption ¶ added in v1.14.0
type RuntimeManifestBuilderOption func(*RuntimeManifestBuilder)
RuntimeManifestBuilderOption is used to configure a RuntimeManifestBuilder.
func RuntimeManifestBuilderWithControllerConfig ¶ added in v1.14.0
func RuntimeManifestBuilderWithControllerConfig(cc *v1alpha1.ControllerConfig) RuntimeManifestBuilderOption
RuntimeManifestBuilderWithControllerConfig sets the controller config to use when building the runtime manifests.
func RuntimeManifestBuilderWithRuntimeConfig ¶ added in v1.14.0
func RuntimeManifestBuilderWithRuntimeConfig(rc *v1beta1.DeploymentRuntimeConfig) RuntimeManifestBuilderOption
RuntimeManifestBuilderWithRuntimeConfig sets the deployment runtime config to use when building the runtime manifests.
func RuntimeManifestBuilderWithServiceAccountPullSecrets ¶ added in v1.14.0
func RuntimeManifestBuilderWithServiceAccountPullSecrets(secrets []corev1.LocalObjectReference) RuntimeManifestBuilderOption
RuntimeManifestBuilderWithServiceAccountPullSecrets sets the service account pull secrets to use when building the runtime manifests.
type ServiceAccountOverride ¶ added in v1.14.0
type ServiceAccountOverride func(sa *corev1.ServiceAccount)
ServiceAccountOverride is a modifier option that overrides a ServiceAccount.
func ServiceAccountWithAdditionalPullSecrets ¶ added in v1.14.0
func ServiceAccountWithAdditionalPullSecrets(secrets []corev1.LocalObjectReference) ServiceAccountOverride
ServiceAccountWithAdditionalPullSecrets adds additional image pull secrets to a ServiceAccount.
func ServiceAccountWithControllerConfig ¶ added in v1.14.0
func ServiceAccountWithControllerConfig(cc *v1alpha1.ControllerConfig) ServiceAccountOverride
ServiceAccountWithControllerConfig overrides the labels, annotations and name of a ServiceAccount with the values defined in the ControllerConfig.
func ServiceAccountWithNamespace ¶ added in v1.14.0
func ServiceAccountWithNamespace(namespace string) ServiceAccountOverride
ServiceAccountWithNamespace overrides the namespace of a ServiceAccount.
func ServiceAccountWithOptionalName ¶ added in v1.14.0
func ServiceAccountWithOptionalName(name string) ServiceAccountOverride
ServiceAccountWithOptionalName overrides the name of a ServiceAccount if empty.
func ServiceAccountWithOwnerReferences ¶ added in v1.14.0
func ServiceAccountWithOwnerReferences(owners []metav1.OwnerReference) ServiceAccountOverride
ServiceAccountWithOwnerReferences overrides the owner references of a ServiceAccount.
type ServiceOverride ¶ added in v1.14.0
ServiceOverride is a modifier option that overrides a Service.
func ServiceWithAdditionalPorts ¶ added in v1.14.0
func ServiceWithAdditionalPorts(ports []corev1.ServicePort) ServiceOverride
ServiceWithAdditionalPorts adds additional ports to a Service.
func ServiceWithClusterIP ¶ added in v1.14.0
func ServiceWithClusterIP(clusterIP string) ServiceOverride
ServiceWithClusterIP overrides the cluster IP of a Service.
func ServiceWithName ¶ added in v1.14.0
func ServiceWithName(name string) ServiceOverride
ServiceWithName overrides the name of a Service.
func ServiceWithNamespace ¶ added in v1.14.0
func ServiceWithNamespace(namespace string) ServiceOverride
ServiceWithNamespace overrides the namespace of a Service.
func ServiceWithOptionalName ¶ added in v1.14.0
func ServiceWithOptionalName(name string) ServiceOverride
ServiceWithOptionalName overrides the name of a Service if empty.
func ServiceWithOwnerReferences ¶ added in v1.14.0
func ServiceWithOwnerReferences(owners []metav1.OwnerReference) ServiceOverride
ServiceWithOwnerReferences overrides the owner references of a Service.
func ServiceWithSelectors ¶ added in v1.14.0
func ServiceWithSelectors(selectors map[string]string) ServiceOverride
ServiceWithSelectors overrides the selectors of a Service.