Skip to content

CLOUD-938 Fix bundle generation automation#1577

Open
jvpasinatto wants to merge 28 commits into
mainfrom
olm-bundle-fixes
Open

CLOUD-938 Fix bundle generation automation#1577
jvpasinatto wants to merge 28 commits into
mainfrom
olm-bundle-fixes

Conversation

@jvpasinatto
Copy link
Copy Markdown
Contributor

@jvpasinatto jvpasinatto commented Apr 30, 2026

CHANGE DESCRIPTION

  • The certified bundle generation now gets the image hashes automatically. It considers all images are already certified. New image tag pattern is:

    • operator-version>
    • <operator-version>-pg-<database-version>
    • <operator-version>-pmm3
    • <operator-version>-pmm2
    • <operator-version>-upgrade
  • Updated OLM bundles for newer OpenShift versions

  • Removed Marketplace bundle generation

  • Updated OLM build tools

  • Improved bundle generation and validation

  • Refreshed CSV metadata, examples, icon, and docs links

  • Unify CW and non CW bundles for certified repository

  • Include upgrade image to bundles

  • Updated olm README

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

Comment thread installers/olm/generate.sh Outdated
@jvpasinatto jvpasinatto marked this pull request as ready for review May 6, 2026 19:33
Comment thread installers/olm/generate.sh Outdated
@valmiranogueira valmiranogueira requested a review from eleo007 as a code owner May 18, 2026 18:26
@valmiranogueira valmiranogueira changed the base branch from main to release-3.0.0 May 18, 2026 18:27
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

shfmt

[shfmt] reported by reviewdog 🐶

log "Manifest validation passed"


[shfmt] reported by reviewdog 🐶

log "Loading CRD descriptions"
crd_descriptions="$(yq '.spec.customresourcedefinitions.owned // []' \
"${project_directory}/config/manifests/bases/${csv_stem}.clusterserviceversion.yaml")" || abort "Failed to load existing CRD descriptions"


[shfmt] reported by reviewdog 🐶

if yq --exit-status 'length > 0' >/dev/null <<<"${crd_descriptions}"; then
log "Using existing CRD descriptions from CSV"
return
fi


[shfmt] reported by reviewdog 🐶

log "Generating CRD descriptions from manifests"
crd_descriptions="$(yq <<<"${operator_crds}" '[


[shfmt] reported by reviewdog 🐶

log "CRD descriptions generated"


[shfmt] reported by reviewdog 🐶

log "Building CRD examples"
crd_examples="$(jq -s '.' \
<(yq '


[shfmt] reported by reviewdog 🐶

<(yq . ../../deploy/backup.yaml) \
<(yq . ../../deploy/restore.yaml) \
<(yq . ../../deploy/upgrade.yaml))" || abort "Failed to build CRD examples"
log "CRD examples built"


[shfmt] reported by reviewdog 🐶

[[ "${DISTRIBUTION}" == "redhat" ]] || { log "Skipping image rewrite for ${DISTRIBUTION}"; return 0; }
log "Rewriting Red Hat alm-examples image references"
rewrite_crd_examples_images crd_examples || abort "Failed to rewrite images"
log "Image rewrite completed"


[shfmt] reported by reviewdog 🐶

log "Rendering ClusterServiceVersion"
csv_stem="$(yq --raw-output '.projectName' "${project_directory}/PROJECT")" || abort "Failed to extract project name"
log "CSV stem: ${csv_stem}"
load_crd_descriptions
build_crd_examples
rewrite_images
log "Generating CSV with yq"
yq --yaml-roundtrip \
--argjson deployment "$(yq <<<"${operator_deployments}" 'first')" \
--arg account "$(yq --raw-output <<<"${operator_accounts}" 'first | .metadata.name')" \
--argjson rules "$(yq <<<"${operator_roles}" 'first | .rules')" \
--argjson cluster_rules "$(yq <<<"${operator_cluster_roles}" 'first | .rules')" \
--argjson crds "${crd_descriptions}" \
--arg examples "${crd_examples}" \
--arg version "${VERSION}" \
--arg minKubeVer "${MIN_KUBE_VERSION}" \
--arg description "$(<description.md)" \
--arg icon "${icon_b64}" \
--arg icon_mime "${bundle_icon_mime}" \
--arg stem "${csv_stem}" \
--arg file_name "${bundle_file_name}" \
--arg disconnected "${disconnected}" \
--argjson related_images "${redhat_related_images}" \
--argjson redhat_skips "${redhat_skips}" \
--arg timestamp "$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
'


[shfmt] reported by reviewdog 🐶

log "CSV rendered: ${bundle_directory}/manifests/${bundle_file_name}.clusterserviceversion.yaml"


[shfmt] reported by reviewdog 🐶

log "No CSV overrides for ${DISTRIBUTION}"


[shfmt] reported by reviewdog 🐶

if command -v tree >/dev/null 2>&1; then
log "Bundle structure:"
tree -C "${bundle_directory}"
else
log "Bundle structure (tree command not available):"
find "${bundle_directory}" -type f | sort | sed 's|^| |'
fi


[shfmt] reported by reviewdog 🐶

log "======================================"
log "OLM Bundle Generation for ${DISTRIBUTION}"
log "======================================"
log "Version: ${VERSION:-unknown}"
log "Distribution: ${DISTRIBUTION}"
log "======================================"
check_tools
load_icon
prepare_distribution
render_operator_manifests
recreate_sdk_project
recreate_bundle_directory
render_scorecard_tests
render_bundle_annotations
render_bundle_dockerfile
write_crd_manifests
validate_manifest_inputs
render_csv
apply_csv_overrides
print_bundle_tree
log "======================================"
log "Bundle generation completed successfully"
log "======================================"

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

shfmt

[shfmt] reported by reviewdog 🐶

yq >/dev/null --exit-status 'length == 1' <<<"${value}" ||
abort "Expected exactly 1 ${name}, found $(yq 'length' <<<"${value}")"


[shfmt] reported by reviewdog 🐶

if [[ "${DISTRIBUTION}" != "redhat" ]]; then


[shfmt] reported by reviewdog 🐶

rewrite_crd_examples_images crd_examples ||
abort "Failed to rewrite images"


[shfmt] reported by reviewdog 🐶

$([[ "${skips}" == \[* ]] && printf '%s' "--argjson" || printf '%s' "--arg") skips "${skips}" \


[shfmt] reported by reviewdog 🐶

>"${bundle_directory}/manifests/${bundle_filename}.clusterserviceversion.yaml" ||
abort "Failed to render CSV"

@valmiranogueira valmiranogueira force-pushed the olm-bundle-fixes branch 6 times, most recently from 455733b to 9e0738f Compare May 18, 2026 23:01
@valmiranogueira valmiranogueira force-pushed the olm-bundle-fixes branch 2 times, most recently from 9e0738f to cff70d4 Compare May 18, 2026 23:02
gkech and others added 10 commits May 19, 2026 15:40
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
* Update PG 14, 15, and 16 for release 3.0.0

* Update pgbouncer for PG 14, 15 and 16
* Fix LDAP permissions for Openshift

* Fix Minio installation on Openshift for migration tests

* Fix migration test name and Minio installation

* Fix lint
* Fix huge pages on AKS

* Use official upgrade image for 3.0.0

* Remove custom-extensions tests (refer to K8SPG-1040)
@JNKPercona
Copy link
Copy Markdown
Collaborator

Test Name Result Time
backup-enable-disable passed 00:13:42
builtin-extensions passed 00:06:03
cert-manager-tls passed 00:10:26
custom-envs passed 00:23:50
custom-tls passed 00:07:14
database-init-sql passed 00:02:28
demand-backup failure 00:37:04
demand-backup-offline-snapshot passed 00:14:25
dynamic-configuration passed 00:03:17
finalizers passed 00:06:25
init-deploy passed 00:03:19
huge-pages passed 00:02:56
major-upgrade-14-to-15 passed 00:10:30
major-upgrade-15-to-16 passed 00:11:13
major-upgrade-16-to-17 passed 00:11:57
major-upgrade-17-to-18 passed 00:09:15
ldap passed 00:05:57
ldap-tls passed 00:05:44
monitoring passed 00:07:55
monitoring-pmm3 passed 00:08:52
one-pod passed 00:06:04
operator-self-healing passed 00:10:32
pitr passed 00:11:56
scaling passed 00:05:08
scheduled-backup passed 00:25:59
self-healing passed 00:09:26
sidecars passed 00:02:40
standby-pgbackrest passed 00:18:57
standby-streaming passed 00:13:38
start-from-backup passed 00:12:20
tablespaces passed 00:07:20
telemetry-transfer passed 00:04:24
upgrade-consistency passed 00:06:21
upgrade-minor passed 00:06:28
users passed 00:04:50
Summary Value
Tests Run 35/35
Job Duration 02:11:39
Total Test Time 05:48:56

commit: 60f4984
image: perconalab/percona-postgresql-operator:PR-1577-60f498444

@valmiranogueira valmiranogueira changed the base branch from release-3.0.0 to main May 26, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants