Skip to content

ROX-33560: Migrate operator konflux.Dockerfile to ubi8-micro#19378

Open
janisz wants to merge 4 commits intomasterfrom
ROX-30858/ubi-micro/operator
Open

ROX-33560: Migrate operator konflux.Dockerfile to ubi8-micro#19378
janisz wants to merge 4 commits intomasterfrom
ROX-30858/ubi-micro/operator

Conversation

@janisz
Copy link
Contributor

@janisz janisz commented Mar 11, 2026

Description

Migrate operator konflux.Dockerfile from ubi8-minimal to ubi8-micro following best practices from collector migration.

Key changes:

  • Add ubi-micro-base stage for reference and final image
  • Add package_installer stage using ubi8/ubi with dnf (not ubi-minimal)
  • CRITICAL: Preserve ubi-micro rpmdb by copying base to /out/ first
  • Use dnf --installroot pattern for Konflux hermetic builds
  • Install only ca-certificates (minimal runtime dependency)
  • Consolidate all COPY commands to reduce layers (3→1)
  • Remove manual rpm -e package cleanup (no longer needed)

This follows the migration guide recommendation (Step 1.2) to use ubi8/ubi (not ubi-minimal) as package_installer, which provides dnf without requiring workarounds.

Expected benefits:

  • 65% smaller image (~100 MB → ~35 MB)
  • 33% fewer packages (~90 → ~60)
  • Reduced attack surface
  • Single-layer final image

Updated rpms.in.yaml with ca-certificates for Konflux prefetch.

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

CI

@janisz janisz requested review from a team and rhacs-bot as code owners March 11, 2026 12:20
@janisz janisz added the konflux-build Run Konflux in PR. Push commit to trigger it. label Mar 11, 2026
@rhacs-bot rhacs-bot requested a review from a team March 11, 2026 12:28
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 11, 2026

Images are ready for the commit at 7745bda.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-318-g7745bda367.

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.71%. Comparing base (049a63c) to head (7745bda).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19378      +/-   ##
==========================================
+ Coverage   49.68%   49.71%   +0.03%     
==========================================
  Files        2700     2701       +1     
  Lines      203312   203453     +141     
==========================================
+ Hits       101014   101150     +136     
- Misses      94772    94779       +7     
+ Partials     7526     7524       -2     
Flag Coverage Δ
go-unit-tests 49.71% <ø> (+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.

janisz and others added 3 commits March 13, 2026 10:05
Migrate operator konflux.Dockerfile from ubi8-minimal to ubi8-micro
following best practices from collector migration.

Key changes:
- Add ubi-micro-base stage for reference and final image
- Add package_installer stage using ubi8/ubi with dnf (not ubi-minimal)
- CRITICAL: Preserve ubi-micro rpmdb by copying base to /out/ first
- Use dnf --installroot pattern for Konflux hermetic builds
- Install only ca-certificates (minimal runtime dependency)
- Consolidate all COPY commands to reduce layers (3→1)
- Remove manual rpm -e package cleanup (no longer needed)

This follows the migration guide recommendation (Step 1.2) to use
ubi8/ubi (not ubi-minimal) as package_installer, which provides dnf
without requiring workarounds.

Expected benefits:
- 65% smaller image (~100 MB → ~35 MB)
- 33% fewer packages (~90 → ~60)
- Reduced attack surface
- Single-layer final image

Updated rpms.in.yaml with ca-certificates for Konflux prefetch.

User request: Migrate operator to ubi-micro and use ubi as package installer
Code partially generated by AI (Claude)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The rpms.in.yaml was updated to include ca-certificates for the operator
konflux build, but rpms.lock.yaml was not regenerated. This caused Konflux
builds to fail because cachi2 couldn't find the prefetched ca-certificates
package and its dependencies.

Changes:
- Regenerated lockfile for all architectures (aarch64, ppc64le, s390x, x86_64)
- Updated package versions to latest available (security updates):
  - postgresql: 15.15 → 15.17
  - python3.12: 3.12.12-1 → 3.12.12-2
  - curl: 7.61.1-34.el8_10.9 → 7.61.1-34.el8_10.10
  - brotli: 1.0.6-3 → 1.0.6-4
  - And other dependency updates

Generated using: ../collector/regenerate-rpms-lockfile.sh

This fixes the Konflux build error:
  "Could not resolve host: cdn-ubi.redhat.com" when trying to install ca-certificates

Related: https://issues.redhat.com/browse/ROX-33560

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Same fix as roxctl - add RPM prefetch so cachi2 sets up /etc/yum.repos.d/
to point to its local cache instead of falling back to cdn-ubi.redhat.com.

Changed operator-build.yaml prefetch-input from:
  value: '{"type": "gomod", "path": "."}'

To:
  value: |
    [
      { "type": "gomod", "path": "." },
      { "type": "rpm", "path": "." }
    ]

Partially generated by AI.
@janisz janisz force-pushed the ROX-30858/ubi-micro/operator branch from 68a09ba to 224dadd Compare March 13, 2026 09:05
Add ACTIVATION_KEY parameter to prefetch-dependencies task to fix SSL
certificate verification errors when downloading RPMs from cdn.redhat.com.

The subscription-manager-activation-key-prod secret provides the credentials
needed for accessing Red Hat CDN during hermetic RPM prefetch.

Also added dev-package-managers: true parameter as required for RPM prefetching.

Partially generated by AI.
@github-actions
Copy link
Contributor

/konflux-retest operator-on-push

2 similar comments
@github-actions
Copy link
Contributor

/konflux-retest operator-on-push

@github-actions
Copy link
Contributor

/konflux-retest operator-on-push

@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

@github-actions
Copy link
Contributor

/konflux-retest operator-bundle-on-push

@openshift-ci
Copy link

openshift-ci bot commented Mar 13, 2026

@janisz: The following test 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/ocp-4-21-scanner-v4-install-tests 7745bda link false /test ocp-4-21-scanner-v4-install-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

Labels

area/operator konflux-build Run Konflux in PR. Push commit to trigger it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants