catalogmigration

package
v0.0.0-...-41c2ede Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, serving, or deletion-preflight 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 source catalogs. 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