Documentation
¶
Index ¶
- Constants
- func SetDeprecationStatus(ext *ocv1.ClusterExtension, bundleName string, ...)
- func SetStatusCondition(conditions *[]metav1.Condition, condition metav1.Condition)
- type Applier
- type BoxcutterRevisionStatesGetter
- type CatalogCache
- type CatalogCachePopulator
- type ClusterCatalogReconciler
- type ClusterExtensionReconciler
- type ClusterExtensionRevisionReconciler
- type ControllerBuilderOption
- type HelmRevisionStatesGetter
- type ReconcileStepFunc
- func ApplyBundle(a Applier) ReconcileStepFunc
- func HandleFinalizers(f finalizer.Finalizer) ReconcileStepFunc
- func MigrateStorage(m StorageMigrator) ReconcileStepFunc
- func ResolveBundle(r resolve.Resolver) ReconcileStepFunc
- func RetrieveRevisionStates(r RevisionStatesGetter) ReconcileStepFunc
- func UnpackBundle(i imageutil.Puller, cache imageutil.Cache) ReconcileStepFunc
- type ReconcileSteps
- type RevisionEngine
- type RevisionMetadata
- type RevisionStates
- type RevisionStatesGetter
- type Sourcerer
- type StorageMigrator
Constants ¶
const ( ClusterExtensionCleanupUnpackCacheFinalizer = "olm.operatorframework.io/cleanup-unpack-cache" ClusterExtensionCleanupContentManagerCacheFinalizer = "olm.operatorframework.io/cleanup-contentmanager-cache" )
Variables ¶
This section is empty.
Functions ¶
func SetDeprecationStatus ¶
func SetDeprecationStatus(ext *ocv1.ClusterExtension, bundleName string, deprecation *declcfg.Deprecation)
SetDeprecationStatus will set the appropriate deprecation statuses for a ClusterExtension based on the provided bundle
func SetStatusCondition ¶ added in v1.5.1
SetStatusCondition wraps apimeta.SetStatusCondition and ensures the message is always truncated This should be used throughout the codebase instead of apimeta.SetStatusCondition directly
Types ¶
type Applier ¶
type Applier interface {
// Apply applies the content in the provided fs.FS using the configuration of the provided ClusterExtension.
// It also takes in a map[string]string to be applied to all applied resources as labels and another
// map[string]string used to create a unique identifier for a stored reference to the resources created.
Apply(context.Context, fs.FS, *ocv1.ClusterExtension, map[string]string, map[string]string) (bool, string, error)
}
type BoxcutterRevisionStatesGetter ¶ added in v1.6.0
func (*BoxcutterRevisionStatesGetter) GetRevisionStates ¶ added in v1.6.0
func (d *BoxcutterRevisionStatesGetter) GetRevisionStates(ctx context.Context, ext *ocv1.ClusterExtension) (*RevisionStates, error)
type CatalogCache ¶
type CatalogCachePopulator ¶
type ClusterCatalogReconciler ¶
type ClusterCatalogReconciler struct {
client.Client
CatalogCache CatalogCache
CatalogCachePopulator CatalogCachePopulator
}
ClusterCatalogReconciler reconciles a ClusterCatalog object
func (*ClusterCatalogReconciler) SetupWithManager ¶
func (r *ClusterCatalogReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ClusterExtensionReconciler ¶
type ClusterExtensionReconciler struct {
client.Client
ReconcileSteps ReconcileSteps
}
ClusterExtensionReconciler reconciles a ClusterExtension object
func (*ClusterExtensionReconciler) Reconcile ¶
func (r *ClusterExtensionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
The operator controller needs to watch all the bundle objects and reconcile accordingly. Though not ideal, but these permissions are required. This has been taken from rukpak, and an issue was created before to discuss it: https://github.com/operator-framework/rukpak/issues/800.
func (*ClusterExtensionReconciler) SetupWithManager ¶
func (r *ClusterExtensionReconciler) SetupWithManager(mgr ctrl.Manager, opts ...ControllerBuilderOption) (crcontroller.Controller, error)
SetupWithManager sets up the controller with the Manager.
type ClusterExtensionRevisionReconciler ¶ added in v1.6.0
type ClusterExtensionRevisionReconciler struct {
Client client.Client
RevisionEngine RevisionEngine
TrackingCache trackingCache
}
ClusterExtensionRevisionReconciler actions individual snapshots of ClusterExtensions, as part of the boxcutter integration.
func (*ClusterExtensionRevisionReconciler) SetupWithManager ¶ added in v1.6.0
func (c *ClusterExtensionRevisionReconciler) SetupWithManager(mgr ctrl.Manager) error
type ControllerBuilderOption ¶ added in v1.6.0
func WithOwns ¶ added in v1.6.0
func WithOwns(obj client.Object) ControllerBuilderOption
type HelmRevisionStatesGetter ¶ added in v1.6.0
type HelmRevisionStatesGetter struct {
helmclient.ActionClientGetter
}
func (*HelmRevisionStatesGetter) GetRevisionStates ¶ added in v1.6.0
func (d *HelmRevisionStatesGetter) GetRevisionStates(ctx context.Context, ext *ocv1.ClusterExtension) (*RevisionStates, error)
type ReconcileStepFunc ¶ added in v1.7.0
type ReconcileStepFunc func(context.Context, *reconcileState, *ocv1.ClusterExtension) (*ctrl.Result, error)
ReconcileStepFunc represents a single step in the ClusterExtension reconciliation process. It takes a context, state and ClusterExtension object as input and returns: - Any error that occurred during reconciliation, which will be returned to the caller - A ctrl.Result that indicates whether reconciliation should complete immediately or be retried later
func ApplyBundle ¶ added in v1.7.0
func ApplyBundle(a Applier) ReconcileStepFunc
func HandleFinalizers ¶ added in v1.7.0
func HandleFinalizers(f finalizer.Finalizer) ReconcileStepFunc
func MigrateStorage ¶ added in v1.7.0
func MigrateStorage(m StorageMigrator) ReconcileStepFunc
func ResolveBundle ¶ added in v1.7.0
func ResolveBundle(r resolve.Resolver) ReconcileStepFunc
func RetrieveRevisionStates ¶ added in v1.7.0
func RetrieveRevisionStates(r RevisionStatesGetter) ReconcileStepFunc
func UnpackBundle ¶ added in v1.7.0
func UnpackBundle(i imageutil.Puller, cache imageutil.Cache) ReconcileStepFunc
type ReconcileSteps ¶ added in v1.7.0
type ReconcileSteps []ReconcileStepFunc
ReconcileSteps is an ordered collection of reconciliation steps that are executed sequentially. Each step receives the shared state from previous steps, allowing data to flow through the pipeline.
func (*ReconcileSteps) Reconcile ¶ added in v1.7.0
func (steps *ReconcileSteps) Reconcile(ctx context.Context, ext *ocv1.ClusterExtension) (ctrl.Result, error)
Reconcile executes a series of reconciliation steps in sequence for a ClusterExtension. It takes a context and ClusterExtension object as input and executes each step in the ReconcileSteps slice. If any step returns an error, reconciliation stops and the error is returned. If any step returns a non-nil ctrl.Result, reconciliation stops, and that result is returned. If all steps complete successfully, returns an empty ctrl.Result and nil error.
type RevisionEngine ¶ added in v1.6.0
type RevisionEngine interface {
Teardown(ctx context.Context, rev machinerytypes.Revision, opts ...machinerytypes.RevisionTeardownOption) (machinery.RevisionTeardownResult, error)
Reconcile(ctx context.Context, rev machinerytypes.Revision, opts ...machinerytypes.RevisionReconcileOption) (machinery.RevisionResult, error)
}
type RevisionMetadata ¶ added in v1.6.0
type RevisionMetadata struct {
Package string
Image string
ocv1.BundleMetadata
}
type RevisionStates ¶ added in v1.6.0
type RevisionStates struct {
Installed *RevisionMetadata
RollingOut []*RevisionMetadata
}
type RevisionStatesGetter ¶ added in v1.6.0
type RevisionStatesGetter interface {
GetRevisionStates(ctx context.Context, ext *ocv1.ClusterExtension) (*RevisionStates, error)
}