bundle

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README

Registry+v1 Bundle Configuration JSON Schema

This directory contains the JSON schema for registry+v1 bundle configuration validation.

Overview

The registryv1bundleconfig.json schema is used to validate the bundle configuration in the ClusterExtension's inline configuration. This includes:

  • watchNamespace: Controls which namespace(s) the operator watches for custom resources
  • deploymentConfig: Customizes operator deployment (environment variables, resources, volumes, etc.)

The deploymentConfig portion is based on OLM v0's SubscriptionConfig struct but excludes the selector field which was never used in v0.

Schema Generation

The schema in registryv1bundleconfig.json is a frozen snapshot that provides stability for validation. It is based on the v1alpha1.SubscriptionConfig type from github.com/operator-framework/api/pkg/operators/v1alpha1/subscription_types.go.

Fields Included
  • nodeSelector: Map of node selector labels
  • tolerations: Array of pod tolerations
  • resources: Container resource requirements (requests/limits)
  • envFrom: Environment variables from ConfigMaps/Secrets
  • env: Individual environment variables
  • volumes: Pod volumes
  • volumeMounts: Container volume mounts
  • affinity: Pod affinity/anti-affinity rules
  • annotations: Custom annotations for deployments/pods
Fields Excluded
  • selector: This field exists in v0's SubscriptionConfig but is never used by the v0 controller. It has been intentionally excluded from the v1 schema.

Regenerating the Schema

To regenerate the schema when the github.com/operator-framework/api dependency is updated:

make update-registryv1-bundle-schema

This will regenerate the schema based on the current module-resolved version of v1alpha1.SubscriptionConfig from github.com/operator-framework/api (as determined via go list -m).

Validation

The schema is used to validate user-provided bundle configuration (including watchNamespace and deploymentConfig) in ClusterExtension resources. The base schema is loaded and customized at runtime based on the operator's install modes to ensure proper validation of the watchNamespace field. Validation happens during:

  1. Admission: When a ClusterExtension is created or updated
  2. Runtime: When extracting configuration from the inline field

Validation errors provide clear, semantic feedback to users about what fields are invalid and why.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegistryV1

type RegistryV1 struct {
	PackageName string
	CSV         v1alpha1.ClusterServiceVersion
	CRDs        []apiextensionsv1.CustomResourceDefinition
	Others      []unstructured.Unstructured
}

func (*RegistryV1) GetConfigSchema added in v1.7.0

func (rv1 *RegistryV1) GetConfigSchema() (map[string]any, error)

GetConfigSchema builds a validation schema based on what install modes the operator supports.

For registry+v1 bundles, we look at the CSV's install modes and generate a schema that matches. For example, if the operator only supports OwnNamespace mode, we'll require the user to provide a watchNamespace that equals the install namespace.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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