Go-based tools for managing operator bundle manifests.
Sorts specDescriptors in CRDs and resolves field dependencies.
Patches ClusterServiceVersion files with version updates, image replacements, and related images configuration.
# Use Go implementation (default)
./dispatch.sh patch-csv [flags] < input.yaml > output.yaml
# Use Python implementation (fallback)
USE_GO_BUNDLE_HELPER=false ./dispatch.sh patch-csv [flags] < input.yaml > output.yamlgo run ./main.go patch-csv [flags] < input.yaml > output.yaml
go run ./main.go fix-spec-descriptor-order < input.yaml > output.yamlcd operator/bundle_helpers
go test ./...
make golangci-lintcd operator
./bundle_helpers/compare-implementations.sh
RELATED_IMAGES_MODE=omit ./bundle_helpers/compare-implementations.sh
RELATED_IMAGES_MODE=downstream ./bundle_helpers/compare-implementations.shNote: For downstream and konflux modes, you need to set RELATED_IMAGE_* environment variables:
export RELATED_IMAGE_MAIN=foo \
RELATED_IMAGE_SCANNER=foo \
RELATED_IMAGE_SCANNER_SLIM=foo \
RELATED_IMAGE_SCANNER_DB=foo \
RELATED_IMAGE_SCANNER_DB_SLIM=foo \
RELATED_IMAGE_COLLECTOR=foo \
RELATED_IMAGE_ROXCTL=foo \
RELATED_IMAGE_CENTRAL_DB=foo \
RELATED_IMAGE_SCANNER_V4_DB=foo \
RELATED_IMAGE_SCANNER_V4=foo
RELATED_IMAGES_MODE=downstream ./bundle_helpers/compare-implementations.shcmd/- CLI command implementationspkg/csv/- CSV patching logic, version handlingpkg/descriptor/- Descriptor sorting and field resolutionpkg/rewrite/- String replacement utilitiespkg/yamlformat/- YAML formatting for Python compatibility
The Go implementation is now the default (USE_GO_BUNDLE_HELPER defaults to true).
Python scripts are retained for reference to check byte-for-byte compatibility.
The Go implementation produces byte-by-byte identical output to the Python implementation for all three related-images modes:
omit- No related images in CSVdownstream- Related images populated from environment variableskonflux- Related images with explicit relatedImages section
CI automatically validates equivalence between Go and Python implementations.