Skip to content

ROX-33563: Migrate scanner image to ubi-micro#17430

Open
janisz wants to merge 30 commits intomasterfrom
ubi-mirco-scanner
Open

ROX-33563: Migrate scanner image to ubi-micro#17430
janisz wants to merge 30 commits intomasterfrom
ubi-mirco-scanner

Conversation

@janisz
Copy link
Copy Markdown
Contributor

@janisz janisz commented Oct 22, 2025

Migrate scanner images from ubi8-minimal to ubi8-micro following the same best practices used for collector migration.

Tested:

  export KUBECONFIG=/tmp/tests/kubeconfig
  kubectl -n stackrox set image deployment/central \
    central=quay.io/rhacs-eng/release-main:4.11.0-388-gc4b4bc65c1-fast
  kubectl -n stackrox set image deployment/scanner-v4-indexer \
    indexer=quay.io/rhacs-eng/release-scanner-v4:4.11.0-394-g97746fa495-fast

  kubectl -n stackrox set image deployment/scanner-v4-matcher \
    matcher=quay.io/rhacs-eng/release-scanner-v4:4.11.0-394-g97746fa495-fast

  kubectl -n stackrox rollout status deployment/central --timeout=5m
  kubectl -n stackrox rollout status deployment/scanner-v4-indexer --timeout=5m
  kubectl -n stackrox rollout status deployment/scanner-v4-matcher --timeout=5m

Then check in UI if everything is healthy and followed and check if scanner is working

roxctl --insecure-skip-tls-verify image scan --image=quay.io/rhacs-eng/release-scanner-v4:4.11.0-394-g97746fa495-fast --output=table
Scan results for image: quay.io/rhacs-eng/release-scanner-v4:4.11.0-394-g97746fa495-fast
   (TOTAL-COMPONENTS: 19, TOTAL-VULNERABILITIES: 50, LOW: 41, MODERATE: 9, IMPORTANT: 0, CRITICAL: 0)
   ```

@janisz janisz requested a review from a team as a code owner October 22, 2025 08:01
@janisz janisz changed the title ROX-30858: Migrate scanner image from ubi8-minimal to ubi8-micro WIP: ROX-30858: Migrate scanner image from ubi8-minimal to ubi8-micro Oct 22, 2025
@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Oct 22, 2025

Images are ready for the commit at e5ba21f.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.10.x-80-ge5ba21f2af.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.32%. Comparing base (4f8098a) to head (48486bb).
⚠️ Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17430      +/-   ##
==========================================
+ Coverage   49.28%   49.32%   +0.04%     
==========================================
  Files        2735     2737       +2     
  Lines      206215   206445     +230     
==========================================
+ Hits       101633   101838     +205     
- Misses      97041    97062      +21     
- Partials     7541     7545       +4     
Flag Coverage Δ
go-unit-tests 49.32% <ø> (+0.04%) ⬆️

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
Copy link
Copy Markdown
Contributor Author

janisz commented Oct 22, 2025

/retest

@janisz janisz added the auto-retest PRs with this label will be automatically retested if prow checks fails label Oct 22, 2025
janisz added a commit that referenced this pull request Oct 23, 2025
The scanner-v4-indexer and scanner-v4-matcher containers were crashing
immediately with exit code 1 because the migration to ubi8-micro removed
essential shell utilities that the entrypoint scripts depend on.

Root cause:
- entrypoint.sh uses #!/usr/bin/env bash
- ubi8-micro has no utilities pre-installed (unlike ubi8-minimal)
- The container fails immediately when trying to execute the bash script

This fix applies the same multi-stage build pattern used in:
- PR #17406 for the main image
- commit cc55af9 for scanner-v4-db

Changes:
1. Added dependency_builder stage using ubi8 (full)
2. Install bash, coreutils, findutils, util-linux, ca-certificates to /out/
3. Copy dependencies from builder to ubi8-micro final stage
4. Removed microdnf/rpm operations from final stage (not available in ubi8-micro)
5. Changed BASE_IMAGE from ubi8-minimal to ubi8-micro

This enables the entrypoint scripts to execute successfully while maintaining
the minimal footprint of ubi8-micro.

Fixes: ROX-30858
Related: #17406, #17430

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rhacs-bot
Copy link
Copy Markdown
Contributor

/retest

2 similar comments
@rhacs-bot
Copy link
Copy Markdown
Contributor

/retest

@rhacs-bot
Copy link
Copy Markdown
Contributor

/retest

@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Oct 23, 2025

Images are ready for the commit at 39afde2.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-337-g39afde24e7.

@janisz janisz changed the title WIP: ROX-30858: Migrate scanner image from ubi8-minimal to ubi8-micro WIP: ROX-30858: Migrate scanner image to ubi8-micro Oct 24, 2025
@janisz janisz changed the title WIP: ROX-30858: Migrate scanner image to ubi8-micro ROX-30858: Migrate scanner image to ubi8-micro Oct 29, 2025
Copy link
Copy Markdown
Contributor

@dcaravel dcaravel left a comment

Choose a reason for hiding this comment

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

IIUC this may break image scanners

@janisz janisz changed the title ROX-30858: Migrate scanner image to ubi8-micro ROX-33563: Migrate scanner image to ubi8-micro Mar 11, 2026
@janisz janisz added the konflux-build Run Konflux in PR. Push commit to trigger it. label Mar 11, 2026
janisz added a commit that referenced this pull request Mar 11, 2026
The scanner-v4-indexer and scanner-v4-matcher containers were crashing
immediately with exit code 1 because the migration to ubi8-micro removed
essential shell utilities that the entrypoint scripts depend on.

Root cause:
- entrypoint.sh uses #!/usr/bin/env bash
- ubi8-micro has no utilities pre-installed (unlike ubi8-minimal)
- The container fails immediately when trying to execute the bash script

This fix applies the same multi-stage build pattern used in:
- PR #17406 for the main image
- commit cc55af9 for scanner-v4-db

Changes:
1. Added dependency_builder stage using ubi8 (full)
2. Install bash, coreutils, findutils, util-linux, ca-certificates to /out/
3. Copy dependencies from builder to ubi8-micro final stage
4. Removed microdnf/rpm operations from final stage (not available in ubi8-micro)
5. Changed BASE_IMAGE from ubi8-minimal to ubi8-micro

This enables the entrypoint scripts to execute successfully while maintaining
the minimal footprint of ubi8-micro.

Fixes: ROX-30858
Related: #17406, #17430

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@janisz janisz force-pushed the ubi-mirco-scanner branch from 7ec8ef2 to 8761059 Compare March 11, 2026 13:16
@janisz janisz requested review from a team and rhacs-bot as code owners March 11, 2026 13:16
@rhacs-bot rhacs-bot requested a review from a team March 11, 2026 13:16
janisz added a commit that referenced this pull request Mar 13, 2026
The scanner-v4-indexer and scanner-v4-matcher containers were crashing
immediately with exit code 1 because the migration to ubi8-micro removed
essential shell utilities that the entrypoint scripts depend on.

Root cause:
- entrypoint.sh uses #!/usr/bin/env bash
- ubi8-micro has no utilities pre-installed (unlike ubi8-minimal)
- The container fails immediately when trying to execute the bash script

This fix applies the same multi-stage build pattern used in:
- PR #17406 for the main image
- commit cc55af9 for scanner-v4-db

Changes:
1. Added dependency_builder stage using ubi8 (full)
2. Install bash, coreutils, findutils, util-linux, ca-certificates to /out/
3. Copy dependencies from builder to ubi8-micro final stage
4. Removed microdnf/rpm operations from final stage (not available in ubi8-micro)
5. Changed BASE_IMAGE from ubi8-minimal to ubi8-micro

This enables the entrypoint scripts to execute successfully while maintaining
the minimal footprint of ubi8-micro.

Fixes: ROX-30858
Related: #17406, #17430

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@janisz janisz force-pushed the ubi-mirco-scanner branch 2 times, most recently from 53adcac to 400c63d Compare March 16, 2026 14:47
Comment on lines 1 to 9
ARG MAPPINGS_REGISTRY=registry.access.redhat.com
ARG MAPPINGS_BASE_IMAGE=ubi8
ARG MAPPINGS_BASE_TAG=latest
ARG RPMS_REGISTRY=registry.access.redhat.com
ARG RPMS_BASE_IMAGE=ubi8
ARG RPMS_BASE_TAG=latest
ARG BASE_REGISTRY=registry.access.redhat.com
ARG BASE_IMAGE=ubi8-minimal
ARG BASE_IMAGE=ubi8-micro
ARG BASE_TAG=latest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the scanner team does not object, I suggest getting rid of these ARGs similar to how I described here #17406 (comment)

janisz and others added 7 commits March 23, 2026 11:39
Co-authored-by: Misha Sugakov <537715+msugakov@users.noreply.github.com>
Co-authored-by: Misha Sugakov <537715+msugakov@users.noreply.github.com>
Co-authored-by: Misha Sugakov <537715+msugakov@users.noreply.github.com>
Co-authored-by: Misha Sugakov <537715+msugakov@users.noreply.github.com>
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Mar 23, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
28930366 Triggered Generic High Entropy Secret 557483a sensor/kubernetes/fake/secret.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Complete scanner UBI 9 upgrade while preserving ubi-micro architecture.

Resolved conflicts in scanner Dockerfiles:
- Updated all ubi8 references to ubi9
- Updated releasever from 8 to 9
- Preserved package_installer pattern with ubi9/ubi-micro
- Updated save-dir-contents path to /etc/pki/ca-trust/source
- Kept direct FROM statements (not ARG-based)

User request: merge master and resolve conflicts after UBI 9 upgrade.

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

rhacs-bot commented Mar 24, 2026

Images are ready for the commit at 48486bb.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-466-g48486bbafd.

Copy link
Copy Markdown
Contributor

@dcaravel dcaravel left a comment

Choose a reason for hiding this comment

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

Few nits for consideration - also believe title of PR should read ubi9-micro (currently says ubi8)

Thanks for taking care of this!

@janisz janisz changed the title ROX-33563: Migrate scanner image to ubi8-micro ROX-33563: Migrate scanner image to ubi-micro Mar 25, 2026
janisz added 2 commits March 25, 2026 10:14
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@janisz
Copy link
Copy Markdown
Contributor Author

janisz commented Mar 26, 2026

/retest

Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@janisz
Copy link
Copy Markdown
Contributor Author

janisz commented Mar 27, 2026

/retest

@stackrox stackrox deleted a comment from rhacs-bot Mar 27, 2026
@rhacs-bot
Copy link
Copy Markdown
Contributor

/retest

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Mar 27, 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/ocp-4-20-scanner-v4-install-tests e78bb32 link false /test ocp-4-20-scanner-v4-install-tests
ci/prow/ocp-4-12-scanner-v4-install-tests 48486bb link false /test ocp-4-12-scanner-v4-install-tests
ci/prow/gke-scanner-v4-install-tests 48486bb link false /test gke-scanner-v4-install-tests
ci/prow/ocp-4-21-scanner-v4-install-tests 48486bb 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/scanner auto-retest PRs with this label will be automatically retested if prow checks fails konflux-build Run Konflux in PR. Push commit to trigger it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants