Documentation
¶
Index ¶
- type BuildResult
- type BundleOption
- func BadImage() BundleOption
- func StaticBundleDir(dir string) BundleOption
- func WithBundleProperty(propertyType, value string) BundleOption
- func WithCRD() BundleOption
- func WithClusterRegistry(host string) BundleOption
- func WithConfigMap() BundleOption
- func WithDeployment() BundleOption
- func WithInstallMode(modes ...v1alpha1.InstallModeType) BundleOption
- func WithLargeCRD(fieldCount int) BundleOption
- type Catalog
- type ChannelOption
- type PackageOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildResult ¶
type BuildResult struct {
// CatalogImageRef is the in-cluster image reference for the ClusterCatalog source.
CatalogImageRef string
// CatalogName is the name to use for the ClusterCatalog resource.
CatalogName string
// PackageNames maps original package names to their scenario-parameterized names.
PackageNames map[string]string
}
BuildResult contains the outputs of a successful catalog build.
type BundleOption ¶
type BundleOption func(*bundleConfig)
BundleOption configures what manifests a bundle contains.
func BadImage ¶
func BadImage() BundleOption
BadImage produces a bundle with CRD and deployment but uses "wrong/image" as the container image, causing ImagePullBackOff at runtime.
func StaticBundleDir ¶
func StaticBundleDir(dir string) BundleOption
StaticBundleDir reads pre-built bundle manifests from the given directory. The bundle content is NOT parameterized — resource names remain as-is. Use this for bundles with real operator binaries that can't have their CRD names changed (e.g. webhook-operator).
func WithBundleProperty ¶
func WithBundleProperty(propertyType, value string) BundleOption
WithBundleProperty adds a property to the bundle's metadata/properties.yaml.
func WithClusterRegistry ¶
func WithClusterRegistry(host string) BundleOption
WithClusterRegistry overrides the cluster registry hostname used in the FBC image reference for this bundle. The bundle is still pushed to the main local registry, but the FBC entry tells the cluster to pull from the specified hostname. This is used for testing registry mirroring via registries.conf.
func WithConfigMap ¶
func WithConfigMap() BundleOption
WithConfigMap includes an additional test ConfigMap in the bundle.
func WithDeployment ¶
func WithDeployment() BundleOption
WithDeployment includes a deployment (with CSV, script ConfigMap, and NetworkPolicy) in the bundle.
func WithInstallMode ¶
func WithInstallMode(modes ...v1alpha1.InstallModeType) BundleOption
WithInstallMode sets the supported install modes for the bundle's CSV. If not called, defaults to AllNamespaces + SingleNamespace. Mode names: AllNamespaces, SingleNamespace, OwnNamespace, MultiNamespace.
func WithLargeCRD ¶
func WithLargeCRD(fieldCount int) BundleOption
WithLargeCRD includes a CRD with many fields to test large bundle handling.
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog is a builder for constructing per-scenario FBC catalogs with parameterized package names and OCI image references.
func NewCatalog ¶
func NewCatalog(name, scenarioID string, opts ...PackageOption) *Catalog
NewCatalog creates a new per-scenario catalog builder.
func (*Catalog) Build ¶
func (c *Catalog) Build(ctx context.Context, tag, localRegistry, clusterRegistry string) (*BuildResult, error)
Build generates all bundle images and the catalog image, pushes them to the registry, and returns the image refs needed to create a ClusterCatalog.
tag is the image tag for the catalog image (e.g. "v1", "latest"). localRegistry is the registry address accessible from the test process (obtained via port-forward). clusterRegistry is the registry address accessible from inside the cluster (e.g. docker-registry.operator-controller-e2e.svc.cluster.local:5000).
type ChannelOption ¶
type ChannelOption func(*entryDef)
ChannelOption configures a channel entry.
func Entry ¶
func Entry(version string, opts ...ChannelOption) ChannelOption
Entry defines a channel entry for a specific version.
func Replaces ¶
func Replaces(version string) ChannelOption
Replaces declares the version this entry replaces.
type PackageOption ¶
type PackageOption func(*packageSpec)
PackageOption configures a package within a catalog.
func Bundle ¶
func Bundle(version string, opts ...BundleOption) PackageOption
Bundle defines a bundle version with its content options.
func Channel ¶
func Channel(name string, entries ...ChannelOption) PackageOption
Channel defines a channel with its entries.
func WithPackage ¶
func WithPackage(name string, opts ...PackageOption) PackageOption
WithPackage defines a package in the catalog.