Skip to content

ACM-38044: update Containerfile.cli base images to floating tags [release-4.18]#9044

Open
yiraeChristineKim wants to merge 1 commit into
openshift:release-4.18from
yiraeChristineKim:yikim/ACM-38044-fix-containerfile-cli-base-images-4.18
Open

ACM-38044: update Containerfile.cli base images to floating tags [release-4.18]#9044
yiraeChristineKim wants to merge 1 commit into
openshift:release-4.18from
yiraeChristineKim:yikim/ACM-38044-fix-containerfile-cli-base-images-4.18

Conversation

@yiraeChristineKim

@yiraeChristineKim yiraeChristineKim commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates Containerfile.cli on release-4.18 to use floating base image tags so each rebuild automatically picks up the latest CVE-fixed layers, improving the catalog security grade for multicluster-engine/hypershift-cli-rhel9.

Changes

Stage Before After
Builder registry.redhat.io/rhel9/go-toolset:1.24.6-1763548439 brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.24
Runtime registry.redhat.io/ubi9/nginx-124:1-1767745334 registry.redhat.io/ubi9/nginx-124:latest
Builder COPY COPY --chown=default . . COPY . .
Runtime COPY COPY --from=builder /hypershift/bin/ ... COPY --chown=1001:0 --from=builder /hypershift/bin/ ...

Why floating tags

The pinned/stale base images are contributing to a catalog grade of D for multicluster-engine/hypershift-cli-rhel9 (MCE 2.8). Floating tags allow rebuilds to pick up current CVE-fixed layers automatically.

Why brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.24

Using the recommended Konflux/CPaaS builder image as suggested by @gparvin.

Why COPY . . (no --chown=default)

The previous image (go-toolset) defined a default user, so --chown=default worked. The new openshift-golang-builder image does not define a default user, causing:

Error: building at STEP "COPY --chown=default . .": user: unknown user error looking up user "default"

Removing --chown=default fixes the build. The builder stage runs as root, which is expected for a build-only stage.

Why --chown=1001:0 on the runtime COPY

Because --chown=default was removed from the builder-stage COPY, the compiled binaries are owned by root. When copied into the runtime stage, the nginx process (uid 1001) cannot delete them during cleanup:

RUN find /opt/app-root/src/ -type f ! -name "*.tar.gz" -delete
`find: cannot delete '/opt/app-root/src/darwin/amd64/hcp': Permission denied

Adding --chown=1001:0 to COPY --from=builder transfers ownership to the nginx user (uid 1001), allowing the find -delete step to succeed. This is the standard pattern for UBI-based runtime images running as a non-root user.

Why only on this branch: release-4.19, release-4.20, and main still use registry.redhat.io/rhel9/go-toolset as the builder, which does define a default user — so their COPY --chown=default continues to work and the binaries are already owned by the correct user when copied to the runtime stage. This change is a consequence of switching to openshift-golang-builder on release-4.18.

Jira

https://redhat.atlassian.net/browse/ACM-38044

Test plan

  • Konflux build for MCE 2.8 passes without Permission denied errors
  • Catalog grade for hypershift-cli improves after rebuild

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f3d826ea-5732-4542-a9db-6ea1bed311c0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from csrwng and sjenning July 21, 2026 14:24
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yiraeChristineKim
Once this PR has been reviewed and has the lgtm label, please assign enxebre for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yiraeChristineKim
yiraeChristineKim force-pushed the yikim/ACM-38044-fix-containerfile-cli-base-images-4.18 branch from 21d7318 to 330bcc4 Compare July 21, 2026 14:26
@yiraeChristineKim

Copy link
Copy Markdown
Contributor Author

/cc @gparvin

@openshift-ci
openshift-ci Bot requested a review from gparvin July 21, 2026 14:29
Comment thread Containerfile.cli Outdated
@yiraeChristineKim
yiraeChristineKim force-pushed the yikim/ACM-38044-fix-containerfile-cli-base-images-4.18 branch from 330bcc4 to c17e7d0 Compare July 21, 2026 15:01
@yiraeChristineKim

Copy link
Copy Markdown
Contributor Author

Thanks @gparvin! Updated to brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.24 as suggested — consistent with the rhel_9_1.22 tag used by the other Containerfiles on this branch.

/area dependency

@openshift-ci openshift-ci Bot added area/dependency Issues or PRs related to dependency changes and removed do-not-merge/needs-area labels Jul 21, 2026
@yiraeChristineKim

Copy link
Copy Markdown
Contributor Author

/retest images

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@yiraeChristineKim: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

/test e2e-aws
/test e2e-conformance
/test e2e-kubevirt-aws-ovn-reduced
/test images
/test mce-images
/test security
/test unit
/test verify

The following commands are available to trigger optional jobs:

/test e2e-aws-metrics
/test e2e-kubevirt-aws-ovn
/test e2e-kubevirt-azure-ovn
/test e2e-kubevirt-metal-conformance

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

pull-ci-openshift-hypershift-release-4.18-e2e-aws
pull-ci-openshift-hypershift-release-4.18-e2e-kubevirt-aws-ovn-reduced
pull-ci-openshift-hypershift-release-4.18-images
pull-ci-openshift-hypershift-release-4.18-mce-images
pull-ci-openshift-hypershift-release-4.18-security
pull-ci-openshift-hypershift-release-4.18-unit
pull-ci-openshift-hypershift-release-4.18-verify
Details

In response to this:

/retest images

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.

@yiraeChristineKim
yiraeChristineKim force-pushed the yikim/ACM-38044-fix-containerfile-cli-base-images-4.18 branch from c17e7d0 to ad432b3 Compare July 21, 2026 15:38
@yiraeChristineKim

Copy link
Copy Markdown
Contributor Author

Fixed the build failure — openshift-golang-builder doesn't define a default user (unlike go-toolset), so COPY --chown=default . . fails. Dropped the --chown=default to match the plain COPY . . used by Containerfile.operator and Containerfile.control-plane on this branch.

…lease-4.18)

Move the hypershift-cli builder and runtime base images off pinned
build-stamp tags to floating tags so rebuilds automatically pick up
the latest CVE-fixed layers.

- Builder: registry.redhat.io/rhel9/go-toolset:1.24.6-1763548439
        → brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.24
- Runtime: registry.redhat.io/ubi9/nginx-124:1-1767745334
        → registry.redhat.io/ubi9/nginx-124:latest

registry.redhat.io/rhel9/go-toolset:1.24 is no longer supported;
using the OpenShift build of the Go toolset on brew.registry.redhat.io,
consistent with the rhel_9_1.22 tag used by Containerfile.operator and
Containerfile.control-plane on this branch.

Drop --chown=default from the builder COPY: openshift-golang-builder
runs as root and does not define a "default" user. Add
--chown=1001:0 to the runtime COPY --from=builder so the binaries
arrive owned by the nginx user (uid 1001) and the find -delete step
can remove the unwanted non-.tar.gz files.

Fixes: https://redhat.atlassian.net/browse/ACM-38044
Co-authored-by: Cursor <cursoragent@cursor.com>
@yiraeChristineKim
yiraeChristineKim force-pushed the yikim/ACM-38044-fix-containerfile-cli-base-images-4.18 branch from ad432b3 to e7428e5 Compare July 21, 2026 18:42
@yiraeChristineKim

Copy link
Copy Markdown
Contributor Author

Fixed another build failure caused by the builder switch:

Root cause: openshift-golang-builder runs as root, so the binaries built in stage 1 are root-owned. When copied to the nginx stage, the nginx user (uid 1001) couldn't find -delete them → Permission denied.

Fix: Added --chown=1001:0 to the COPY --from=builder in the runtime stage so the binaries arrive owned by the nginx user.

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@yiraeChristineKim: 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/e2e-aws e7428e5 link true /test e2e-aws

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.

@jparrill jparrill left a comment

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.

A few concerns with this PR:

1. Missing PRs for 4.19, 4.20, etc... — Both release-4.19 and release-4.20 have the same stale nginx-124:1-1767745334 pinned image. If the goal is to fix the catalog grade for stale base images, the same fix should apply to those branches too. The standard process is to fix in main first (already done there) and cherry-pick backwards — not to target only the oldest affected branch.

2. PR description doesn't match the diff — The description says "Both images stay on registry.redhat.io (no registry change)" but the builder actually changes from registry.redhat.io/rhel9/go-toolset to brew.registry.redhat.io/rh-osbs/openshift-golang-builder. That's a registry and image change.

3. No OCPBUGS ticket — Changes to release branches should have an associated OCPBUGS for traceability in the OCP release process. ACM-38044 is an ACM-scoped ticket, not an OCP one.

4. Undocumented functional change — The --chown=1001:0 addition on the runtime COPY is a functional change that isn't mentioned in the PR description or rationale. See inline comment.

Comment thread Containerfile.cli
Comment thread Containerfile.cli
FROM registry.redhat.io/ubi9/nginx-124:latest

COPY --from=builder /hypershift/bin/ /opt/app-root/src/
COPY --chown=1001:0 --from=builder /hypershift/bin/ /opt/app-root/src/

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.

This --chown=1001:0 doesn't exist on release-4.19, release-4.20, or main. What's the rationale for adding it only here? This is a functional change (changes file ownership in the runtime image) that isn't mentioned in the PR description.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let me add to description why I change this

@jparrill

Copy link
Copy Markdown
Contributor

/retitle ACM-38044: update Containerfile.cli base images to floating tags [release-4.18]

@openshift-ci openshift-ci Bot changed the title build(cli): update Containerfile.cli base images to floating tags (release-4.18) ACM-38044: update Containerfile.cli base images to floating tags [release-4.18] Jul 22, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 22, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@yiraeChristineKim: This pull request references ACM-38044 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.z" version, but no target version was set.

Details

In response to this:

Summary

Updates Containerfile.cli on release-4.18 to use floating base image tags so each rebuild automatically picks up the latest CVE-fixed layers, improving the catalog security grade for multicluster-engine/hypershift-cli-rhel9.

Changes

Stage Before After
Builder registry.redhat.io/rhel9/go-toolset:1.24.6-1763548439 registry.redhat.io/rhel9/go-toolset:1.24
Runtime registry.redhat.io/ubi9/nginx-124:1-1767745334 registry.redhat.io/ubi9/nginx-124:latest

Both images stay on registry.redhat.io (no registry change). The build-stamp suffixes are dropped so future rebuilds pull the latest 1.24.x Go toolset and nginx layers automatically.

Why

The pinned/stale base images (including a rhel9.4 ELS layer not refreshed since May) are contributing to a catalog grade of D for multicluster-engine/hypershift-cli-rhel9 (MCE 2.8). Floating tags allow rebuilds to pick up current fixed layers.

Jira

https://redhat.atlassian.net/browse/ACM-38044

Test plan

  • Hypershift CLI image builds successfully for MCE 2.8
  • Catalog grade for hypershift-cli improves after rebuild

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 openshift-eng/jira-lifecycle-plugin repository.

@yiraeChristineKim

yiraeChristineKim commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@jparrill Missing PRs for 4.19, 4.20 -> We only got 4.18 alert so far when we get other alert then I will open a PR

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

Labels

area/dependency Issues or PRs related to dependency changes jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants