catalogmigration

package
v0.0.0-...-a58de47 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package catalogmigration maps image-backed OLMv0 CatalogSources to OLMv1 ClusterCatalogs. It can create a catalog or adopt an existing catalog with the same image. Unsupported sources are reported as skipped rather than converted. MigrateCatalogs returns a result for each source, so callers must inspect per-source statuses as well as the returned error.

Index

Constants

View Source
const (
	// MigratedFromCatalogSourceAnnotation is set on ClusterCatalog when first created or adopted.
	MigratedFromCatalogSourceAnnotation = "olm.operatorframework.io/migrated-from-catalogsource"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogMigrationResult

type CatalogMigrationResult struct {
	CatalogSourceName      string
	CatalogSourceNamespace string
	ClusterCatalogName     string
	Status                 string // "created", "adopted", "skipped", "error", "dry-run"
	Reason                 string
	Notes                  []string // informational notices (e.g. dropped fields with no OLMv1 equivalent)
}

CatalogMigrationResult describes one CatalogSource outcome. Status is "created", "adopted", "skipped", "error", or "dry-run". Reason explains the outcome and Notes describe source settings without an OLMv1 equivalent.

type CatalogMigrator

type CatalogMigrator struct {
	Client client.Client
	// Progress receives the same typed, synchronous events as migration.Migrator.
	// Per-source outcomes remain available in MigrateCatalogs results.
	Progress migration.ProgressFunc
}

CatalogMigrator migrates OLMv0 CatalogSources to OLMv1 ClusterCatalogs.

func NewCatalogMigrator

func NewCatalogMigrator(c client.Client) *CatalogMigrator

NewCatalogMigrator creates a new CatalogMigrator.

func (*CatalogMigrator) MigrateCatalogs

MigrateCatalogs processes CatalogSources in all namespaces. Only grpc sources with spec.image can become ClusterCatalogs; unsupported sources are returned as skipped results. Existing catalogs with matching images are adopted, and Sources with the same name share a catalog only when all have the same image. If any image differs, all sources in that group are namespace-qualified.

The returned slice contains one outcome per source. Per-source create, annotation, or serving failures appear as results with Status "error" rather than as the returned error; callers must inspect every result. The returned error covers failures to list the required cluster objects. DryRun reports proposed actions without creating or annotating catalogs.

type CatalogMigratorOptions

type CatalogMigratorOptions struct {
	DryRun                      bool
	DeleteCatalogSource         bool
	AcknowledgePriorityOverflow bool
}

CatalogMigratorOptions configures catalog migration. DryRun reports proposed changes without mutating catalogs. DeleteCatalogSource requests source deletion only when no Subscription references it. AcknowledgePriorityOverflow permits out-of-range priorities to be capped to int32 limits.

Jump to

Keyboard shortcuts

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