Skip to content

ROX-33562: migrate central-db to ubi9-micro#19797

Open
janisz wants to merge 1 commit intomasterfrom
ROX-33562/ubi-micro-central-db
Open

ROX-33562: migrate central-db to ubi9-micro#19797
janisz wants to merge 1 commit intomasterfrom
ROX-33562/ubi-micro-central-db

Conversation

@janisz
Copy link
Copy Markdown
Contributor

@janisz janisz commented Apr 2, 2026

Description

Migrates central-db from quay.io/sclorg/postgresql-15-c9s to ubi9-micro base image following the pattern established by scanner-db migration.

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!

Migrates central-db from quay.io/sclorg/postgresql-15-c9s to ubi9-micro
base image following the pattern established by scanner-db migration.

Why:
- Reduce attack surface by removing package managers from runtime image
- Decrease image size (~280MB vs ~300MB+ with full C9S base)
- Align with StackRox UBI-micro migration strategy

Changes:
- Four-stage build: postgres_rpms → ubi-micro-base → dependency_builder → final
- Download PostgreSQL 15 RPMs from PGDG repository
- Install minimal runtime dependencies (17 packages vs full base)
- Preserve RPM database integrity by copying ubi-micro-base before package install
- Handle tzdata special case (reinstall with --setopt=reposdir)
- Create postgres user/group with UID/GID 70 via chroot
- Use --allowerasing to replace coreutils-single with coreutils (needed by scripts)

Verification:
- PostgreSQL 15.17 installed and working
- No package managers in final image (rpm not found)
- bash, findutils, util-linux present for scripts
- Timezone data populated correctly
- User UID/GID 70 as expected
- Image size: 281MB

Partially generated with AI assistance.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.59%. Comparing base (496d0ac) to head (f6ca642).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19797   +/-   ##
=======================================
  Coverage   49.59%   49.59%           
=======================================
  Files        2761     2763    +2     
  Lines      208143   208167   +24     
=======================================
+ Hits       103226   103250   +24     
  Misses      97252    97252           
  Partials     7665     7665           
Flag Coverage Δ
go-unit-tests 49.59% <ø> (+<0.01%) ⬆️

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.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 2, 2026

@janisz: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/gke-scanner-v4-install-tests f6ca642 link false /test gke-scanner-v4-install-tests
ci/prow/gke-ui-e2e-tests f6ca642 link true /test gke-ui-e2e-tests
ci/prow/gke-operator-e2e-tests f6ca642 link false /test gke-operator-e2e-tests
ci/prow/ocp-4-12-qa-e2e-tests f6ca642 link false /test ocp-4-12-qa-e2e-tests
ci/prow/gke-upgrade-tests f6ca642 link false /test gke-upgrade-tests
ci/prow/gke-nongroovy-e2e-tests f6ca642 link true /test gke-nongroovy-e2e-tests
ci/prow/gke-qa-e2e-tests f6ca642 link false /test gke-qa-e2e-tests
ci/prow/ocp-4-12-nongroovy-e2e-tests f6ca642 link false /test ocp-4-12-nongroovy-e2e-tests
ci/prow/ocp-4-12-scanner-v4-install-tests f6ca642 link false /test ocp-4-12-scanner-v4-install-tests
ci/prow/ocp-4-12-operator-e2e-tests f6ca642 link false /test ocp-4-12-operator-e2e-tests
ci/prow/ocp-4-21-qa-e2e-tests f6ca642 link false /test ocp-4-21-qa-e2e-tests
ci/prow/ocp-4-21-nongroovy-e2e-tests f6ca642 link false /test ocp-4-21-nongroovy-e2e-tests
ci/prow/ocp-4-21-scanner-v4-install-tests f6ca642 link false /test ocp-4-21-scanner-v4-install-tests
ci/prow/ocp-4-21-operator-e2e-tests f6ca642 link false /test ocp-4-21-operator-e2e-tests

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

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.

1 participant