Skip to content

chore(build): Upgrade to UBI9#18364

Draft
davdhacs wants to merge 16 commits intomasterfrom
rox-14475-ubi9-acs411
Draft

chore(build): Upgrade to UBI9#18364
davdhacs wants to merge 16 commits intomasterfrom
rox-14475-ubi9-acs411

Conversation

@davdhacs
Copy link
Contributor

@davdhacs davdhacs commented Jan 5, 2026

Description

base image migration from UBI/rhel 8 to 9.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

change me!

@openshift-ci
Copy link

openshift-ci bot commented Jan 5, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The apollo-ci image tag stackrox-test-0.5.1-5-ga9b384f054/scanner-test-0.5.1-5-ga9b384f054 is repeated across many workflows; consider centralizing this in a single variable (e.g., via env or a reusable workflow) to keep future updates consistent.
  • The central-entrypoint.sh root-handling block currently has a TODO (DO NOT MERGE) and relies on su-exec, which is noted as missing; please either restore a working user-switching mechanism for UBI9 or remove/adjust this conditional before merging.
  • In scanner/image/scanner/Dockerfile, the save-dir-contents call was narrowed to /etc/pki/ca-trust/source; verify that corresponding restore logic and comments are updated to reflect this narrower scope so it’s clear what is actually persisted.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The apollo-ci image tag `stackrox-test-0.5.1-5-ga9b384f054`/`scanner-test-0.5.1-5-ga9b384f054` is repeated across many workflows; consider centralizing this in a single variable (e.g., via `env` or a reusable workflow) to keep future updates consistent.
- The `central-entrypoint.sh` root-handling block currently has a `TODO (DO NOT MERGE)` and relies on `su-exec`, which is noted as missing; please either restore a working user-switching mechanism for UBI9 or remove/adjust this conditional before merging.
- In `scanner/image/scanner/Dockerfile`, the `save-dir-contents` call was narrowed to `/etc/pki/ca-trust/source`; verify that corresponding restore logic and comments are updated to reflect this narrower scope so it’s clear what is actually persisted.

## Individual Comments

### Comment 1
<location> `image/rhel/static-bin/central-entrypoint.sh:21-26` </location>
<code_context>
         echo >&2 "Warning: failed to change permissions of one or more directories. Startup may fail."
      fi

+     # TODO(DO NOT MERGE): exec: su-exec: not found
+     #  Is this entire conditional still relevant? If so, perhaps we can make it
+     #  better.
+     #  Doesn't seem to work in UBI8 either.
+     #  Also, the conditional itself isn't POSIX-compliant (should be `[ "$(id -u)" = "0" ]`)
      exec su-exec 4000:4000 "$0" "$@"
 fi

</code_context>

<issue_to_address>
**issue (bug_risk):** Committing a `DO NOT MERGE` TODO and relying on `su-exec` (likely absent in UBI9) is risky.

This still unconditionally calls `exec su-exec ...`, so on UBI9/UBI8 the container will likely fail to start because `su-exec` isn’t present. If UID dropping is still needed, consider switching to something available in the base image (e.g. `runuser`, `gosu`, or `setpriv`), or remove this branch if everything now runs as the target UID. Also, the `DO NOT MERGE` TODO should be resolved or removed before committing.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@davdhacs davdhacs added the konflux-build Run Konflux in PR. Push commit to trigger it. label Jan 5, 2026
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Jan 5, 2026

Images are ready for the commit at f16b33c.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-320-gf16b33cc67.

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.68%. Comparing base (69581a7) to head (f16b33c).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18364      +/-   ##
==========================================
+ Coverage   49.65%   49.68%   +0.03%     
==========================================
  Files        2698     2700       +2     
  Lines      203132   203297     +165     
==========================================
+ Hits       100860   101014     +154     
- Misses      94748    94757       +9     
- Partials     7524     7526       +2     
Flag Coverage Δ
go-unit-tests 49.68% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@davdhacs
Copy link
Contributor Author

davdhacs commented Jan 5, 2026

/test ocp-4-20-qa-e2e-tests

@davdhacs davdhacs force-pushed the rox-14475-ubi9-acs411 branch 3 times, most recently from 709ad18 to 0354dd6 Compare January 12, 2026 23:15
@davdhacs davdhacs force-pushed the rox-14475-ubi9-acs411 branch 2 times, most recently from efdc34e to 84236ee Compare January 19, 2026 16:11
@davdhacs davdhacs force-pushed the rox-14475-ubi9-acs411 branch 2 times, most recently from e2cc9c0 to c9e89ad Compare January 29, 2026 00:02
@davdhacs davdhacs force-pushed the rox-14475-ubi9-acs411 branch from c9e89ad to 515f592 Compare January 29, 2026 03:34
@github-actions github-actions bot added the ci-all-qa-tests Tells CI to run all API tests (not just BAT). label Jan 29, 2026
@davdhacs
Copy link
Contributor Author

/test gke-nongroovy-e2e-tests
/test gke-ui-e2e-tests
/test aks-qa-e2e-tests

@davdhacs
Copy link
Contributor Author

/test gke-qa-e2e-tests

@davdhacs
Copy link
Contributor Author

/test gke-nongroovy-e2e-tests
/test gke-ui-e2e-tests
/test ocp-4-20-qa-e2e-tests

@davdhacs davdhacs force-pushed the rox-14475-ubi9-acs411 branch from a05e9b2 to 448ded1 Compare January 30, 2026 20:44
@davdhacs
Copy link
Contributor Author

/test gke-qa-e2e-tests
/test gke-nongroovy-e2e-tests
/test gke-ui-e2e-tests
/test ocp-4-20-qa-e2e-tests

@openshift-ci
Copy link

openshift-ci bot commented Jan 30, 2026

@github-actions[bot]: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

/test gke-nongroovy-e2e-tests
/test gke-ui-e2e-tests

The following commands are available to trigger optional jobs:

/test aks-qa-e2e-tests
/test aro-qa-e2e-tests
/test eks-qa-e2e-tests
/test gke-external-pg-17-qa-e2e-tests
/test gke-latest-nongroovy-e2e-tests
/test gke-latest-operator-e2e-tests
/test gke-latest-qa-e2e-tests
/test gke-latest-ui-e2e-tests
/test gke-nongroovy-compatibility-tests
/test gke-oldest-nongroovy-e2e-tests
/test gke-oldest-operator-e2e-tests
/test gke-oldest-qa-e2e-tests
/test gke-oldest-ui-e2e-tests
/test gke-operator-e2e-tests
/test gke-qa-e2e-tests
/test gke-race-condition-qa-e2e-tests
/test gke-scale-tests
/test gke-scanner-v4-install-tests
/test gke-sensor-integration-tests
/test gke-upgrade-tests
/test gke-version-compatibility-tests
/test ibmcloudz-4-14-qa-e2e-tests
/test ibmcloudz-4-15-qa-e2e-tests
/test ibmcloudz-4-16-qa-e2e-tests
/test ibmcloudz-4-17-qa-e2e-tests
/test ocp-4-12-compliance-e2e-tests
/test ocp-4-12-nongroovy-e2e-tests
/test ocp-4-12-operator-e2e-tests
/test ocp-4-12-qa-e2e-tests
/test ocp-4-12-scanner-v4-install-tests
/test ocp-4-12-sensor-integration-tests
/test ocp-4-12-ui-e2e-tests
/test ocp-4-20-compliance-e2e-tests
/test ocp-4-20-crun-qa-e2e-tests
/test ocp-4-20-fips-qa-e2e-tests
/test ocp-4-20-nongroovy-e2e-tests
/test ocp-4-20-operator-e2e-tests
/test ocp-4-20-qa-e2e-tests
/test ocp-4-20-scanner-v4-install-tests
/test ocp-4-20-sensor-integration-tests
/test ocp-4-20-ui-e2e-tests
/test ocp-4-21-compliance-e2e-tests
/test ocp-4-21-crun-qa-e2e-tests
/test ocp-4-21-fips-qa-e2e-tests
/test ocp-4-21-nongroovy-e2e-tests
/test ocp-4-21-operator-e2e-tests
/test ocp-4-21-qa-e2e-tests
/test ocp-4-21-scanner-v4-install-tests
/test ocp-4-21-sensor-integration-tests
/test ocp-4-21-ui-e2e-tests
/test ocp-dev-preview-compliance-e2e-tests
/test ocp-dev-preview-fips-qa-e2e-tests
/test ocp-dev-preview-nongroovy-e2e-tests
/test ocp-dev-preview-operator-e2e-tests
/test ocp-dev-preview-qa-e2e-tests
/test ocp-dev-preview-scanner-v4-install-tests
/test ocp-dev-preview-sensor-integration-tests
/test ocp-dev-preview-ui-e2e-tests
/test ocp-next-candidate-compliance-e2e-tests
/test ocp-next-candidate-fips-qa-e2e-tests
/test ocp-next-candidate-nongroovy-e2e-tests
/test ocp-next-candidate-operator-e2e-tests
/test ocp-next-candidate-qa-e2e-tests
/test ocp-next-candidate-scanner-v4-install-tests
/test ocp-next-candidate-sensor-integration-tests
/test ocp-next-candidate-ui-e2e-tests
/test ocp-stable-scanner-v4-install-compliance-e2e-tests
/test ocp-stable-scanner-v4-install-nongroovy-e2e-tests
/test ocp-stable-scanner-v4-install-operator-e2e-tests
/test ocp-stable-scanner-v4-install-qa-e2e-tests
/test ocp-stable-scanner-v4-install-scanner-v4-install-tests
/test ocp-stable-scanner-v4-install-sensor-integration-tests
/test ocp-stable-scanner-v4-install-ui-e2e-tests
/test osd-aws-qa-e2e-tests
/test osd-gcp-qa-e2e-tests
/test powervs-4-14-qa-corebpf-e2e-tests
/test powervs-4-15-qa-corebpf-e2e-tests
/test powervs-4-16-qa-corebpf-e2e-tests
/test powervs-4-17-qa-corebpf-e2e-tests
/test powervs-4-18-qa-corebpf-e2e-tests
/test powervs-4-19-qa-corebpf-e2e-tests
/test powervs-4-20-qa-corebpf-e2e-tests
/test rosa-fips-qa-e2e-tests
/test rosa-hcp-qa-e2e-tests
/test rosa-qa-e2e-tests

Use /test all to run the following jobs that were automatically triggered:

pull-ci-stackrox-stackrox-master-gke-nongroovy-e2e-tests
pull-ci-stackrox-stackrox-master-gke-operator-e2e-tests
pull-ci-stackrox-stackrox-master-gke-qa-e2e-tests
pull-ci-stackrox-stackrox-master-gke-scanner-v4-install-tests
pull-ci-stackrox-stackrox-master-gke-ui-e2e-tests
pull-ci-stackrox-stackrox-master-gke-upgrade-tests
pull-ci-stackrox-stackrox-master-ocp-4-12-nongroovy-e2e-tests
pull-ci-stackrox-stackrox-master-ocp-4-12-operator-e2e-tests
pull-ci-stackrox-stackrox-master-ocp-4-12-qa-e2e-tests
pull-ci-stackrox-stackrox-master-ocp-4-12-scanner-v4-install-tests
pull-ci-stackrox-stackrox-master-ocp-4-20-nongroovy-e2e-tests
pull-ci-stackrox-stackrox-master-ocp-4-20-operator-e2e-tests
pull-ci-stackrox-stackrox-master-ocp-4-20-qa-e2e-tests
pull-ci-stackrox-stackrox-master-ocp-4-20-scanner-v4-install-tests
Details

In response to this:

/retest operator-bundle-on-push

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

davdhacs and others added 5 commits March 11, 2026 14:39
Update ImageDigestMirrorSet, COMPONENT_MAPPINGS, and operator-bundle
pipeline to reference rhel9 image repositories instead of rhel8.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update all hardcoded rhel8 image names to rhel9 in:
- pkg/images/defaults/flavor.go (RHACS release flavor)
- deploy/k8s/sensor-deploy/chart/internal/defaults/50-images.yaml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Go builder: rhel_8_golang_1.25 -> rhel_9_golang_1.25
- Runtime: ubi8/ubi-minimal -> ubi9/ubi-minimal
- PostgreSQL: rhel8/postgresql-15 -> rhel9/postgresql-15
- Labels: rhacs-*-rhel8 -> rhacs-*-rhel9
- Stripped stale sha256 digests (will be repinned by Mintmaker)

Affected images: main, roxctl, central-db, operator, operator-bundle,
scanner-v4, scanner-v4-db

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update ARG defaults and FROM references from ubi8/rhel8 to ubi9/rhel9
in development/CI Dockerfiles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update helm test expectations, scanner mappers test, and release
verification script to reference rhel9 image names.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs davdhacs force-pushed the rox-14475-ubi9-acs411 branch from 411fc15 to ec08506 Compare March 11, 2026 21:05
davdhacs and others added 6 commits March 11, 2026 15:23
Change pg_rhel_major from 8 to 9 in download scripts so PostgreSQL
RPMs are fetched from the RHEL9 PGDG repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The brew.registry.redhat.io requires pinned digests for image pulls.
Use the known-good digest for rhel_9_golang_1.25 from the scanner PR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update image_reference_regex helper and interactive flavors test
to expect rhel9 image names in generated deployment manifests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update flavor-interactive.expect.tcl to match rhel9 image names
in the RHACS special-case patterns for central-db, main, scanner,
scanner-db, scanner-v4, and scanner-v4-db.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
In UBI9, update-ca-trust requires the -o flag to specify the output
directory when running as a non-root user. This matches the workaround
applied in the scanner repo (PR #2562).

See: https://bugzilla.redhat.com/show_bug.cgi?id=2241240

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- .tekton/*-build.yaml: CPE labels el8 -> el9
- operator/Dockerfile: ubi9-micro -> ubi9-minimal (matches Konflux)
- rpms.rhel.repo: RHEL 8 repos -> RHEL 9

Note: rpms.lock.yaml needs regeneration (not included in this commit).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs
Copy link
Contributor Author

/konflux-retest main-on-push

UBI9-minimal's microdnf does not support modularity. PostgreSQL 15 is
available directly in UBI9 repos without needing module enable.

This was causing the main-on-push Konflux build to fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs
Copy link
Contributor Author

/konflux-retest main-on-push

@davdhacs davdhacs force-pushed the rox-14475-ubi9-acs411 branch from 6e594af to cc5ed9f Compare March 12, 2026 17:22
@davdhacs
Copy link
Contributor Author

/konflux-retest operator-bundle-on-push

On UBI9-minimal, python3.12 is installed but python3 is not
automatically symlinked. Use alternatives to create the symlink,
matching Moritz's fix in mc/ubi9.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs davdhacs force-pushed the rox-14475-ubi9-acs411 branch from cc5ed9f to 4b6558f Compare March 12, 2026 22:04
davdhacs and others added 2 commits March 12, 2026 16:35
deploy/k8s/sensor-deploy/chart/internal/defaults/50-images.yaml is
gitignored and generated at deploy time from flavor.go defaults.
Should not be committed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Konflux build environment has entitlement certificates and needs
module enable to resolve postgresql 15 from the RHEL 9 appstream.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs
Copy link
Contributor Author

/konflux-retest main-on-push

The lock file must reference RHEL 9 repos for Konflux prefetch to
work with UBI9 base images. Previous commits failed to persist this
change. Sourced from Moritz's mc/ubi9 branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

/konflux-retest operator-bundle-on-push

2 similar comments
@github-actions
Copy link
Contributor

/konflux-retest operator-bundle-on-push

@davdhacs
Copy link
Contributor Author

/konflux-retest operator-bundle-on-push

@davdhacs
Copy link
Contributor Author

/konflux-retest main-on-push

@davdhacs
Copy link
Contributor Author

/konflux-retest operator-bundle-on-push

@davdhacs
Copy link
Contributor Author

/konflux-retest create-custom-snapshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants