OCPBUGS-70012: Updating ose-cluster-kube-apiserver-operator-container image to be consistent with ART for 4.22#1989
Conversation
|
Created by ART pipeline job run https://art-jenkins.apps.prod-stable-spoke1-dc-iad2.itup.redhat.com/job/scheduled-builds/job/sync-ci-images/48106 |
07e93d8 to
b835527
Compare
WalkthroughBuild and image configuration updated to reference OpenShift 4.22 and Go 1.25; Dockerfile builder and base image tags updated accordingly. Image copy steps for bootkube manifests, operator binary, and test archive remain; an ENTRYPOINT line is commented out. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
/lgtm |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
okd-scos-images is fixed by PR openshift/release#72981 |
|
/jira refresh The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
/test okd-scos-images |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
/hold Revision b835527 was retested 3 times: holding |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
b835527 to
730ec1b
Compare
|
/lgtm |
|
/verified by CI |
|
@p0lyn0mial: This PR has been marked as verified by DetailsIn response to this:
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. |
|
/lgtm cancel |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: openshift-bot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
730ec1b to
f7ec834
Compare
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Dockerfile.rhel7`:
- Line 1: The Dockerfile's stages (FROM
registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS
builder and the final image stage) do not set an explicit non-root user required
by DS-0002; inspect or choose a non-root username/UID available in the base
images and add an explicit USER directive in the final stage (and any
intermediate runtime stage if present) to switch from root to that non-root
account so the container does not run as UID 0.
ℹ️ Review info
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
.ci-operator.yamlDockerfile.rhel7
| @@ -1,11 +1,11 @@ | |||
| FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS builder | |||
| FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder | |||
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find . -name "Dockerfile.rhel7" -type fRepository: openshift/cluster-kube-apiserver-operator
Length of output: 103
🏁 Script executed:
head -20 ./Dockerfile.rhel7Repository: openshift/cluster-kube-apiserver-operator
Length of output: 1769
🏁 Script executed:
cat -n ./Dockerfile.rhel7 | tail -20Repository: openshift/cluster-kube-apiserver-operator
Length of output: 1879
🏁 Script executed:
rg "^USER " ./Dockerfile.rhel7Repository: openshift/cluster-kube-apiserver-operator
Length of output: 67
🏁 Script executed:
wc -l ./Dockerfile.rhel7Repository: openshift/cluster-kube-apiserver-operator
Length of output: 106
🌐 Web query:
openshift 4.22 base-rhel9 image default user configuration
💡 Result:
For the OpenShift base-rhel9-style base images (UBI/RHEL 9 based), the “default user” behavior is:
- Inside the image (Dockerfile
USER): if the image does not setUSER, containers default to root (UID 0) per OCI/Docker semantics. [2] - At runtime on OpenShift (SCC/PodSecurity): OpenShift typically runs pods as an arbitrary, non-root UID (not necessarily the Dockerfile
USER), and that UID is commonly in GID 0 (root group). [1][3] - UBI “runtime language” images (for example UBI OpenJDK, etc.) often already switch to a non-root user (commonly a
defaultuser / non-root UID such as 1001) in the base image, but OpenShift can still override with an arbitrary UID at runtime. [1]
What to do (recommended)
- Build images to be arbitrary-UID friendly: make writable paths group-owned by 0 and group-writable (the common pattern is
chown -R 0:<dir> && chmod -R g=u <dir>), because OpenShift assigns an arbitrary UID that is typically in the root group. [1][3] - If you truly need a fixed UID, you must set
securityContext.runAsUserand ensure your cluster policy allows it (often requires SCC changes) — otherwise assume arbitrary UID. [1]
How to verify the image’s configured default user
podman inspect --format '{{.Config.User}}' <image>(empty means “root” by default) [2]
🌐 Web query:
registry.ci.openshift.org ocp 4.22 base-rhel9 USER default root
💡 Result:
USER defaultis an S2I builder-image convention (i.e., the image provides a Linux user literally nameddefault, and you switch to it in the Dockerfile after installs). (stackoverflow.com)registry.ci.openshift.org/ocp/4.22:base-rhel9is not an S2I builder image, so you should not assume adefaultusername exists there. If an image doesn’t set an OCI/DockerUSER, the effective default is root (UID 0).- Also note: on OpenShift, pods commonly run with an arbitrary UID at runtime (regardless of what the image “defaults” to), so images should be compatible with arbitrary UIDs via permissions/group
0patterns. (gist.github.com)
To confirm what the image declares, inspect the remote config:
skopeo inspect --config docker://registry.ci.openshift.org/ocp/4.22:base-rhel9 | jq -r '.config.User'
# empty output => rootIf you need a named non-root user, you must create it in your derived Dockerfile and then USER <name-or-uid>.
Citations:
- 1: https://stackoverflow.com/questions/48386832/how-to-run-base-centos-image-in-minishift?utm_source=openai
- 2: https://gist.github.com/shinomineko/3bb6ed593b1d5aecc8752e2dfc6f0083?utm_source=openai
🌐 Web query:
openshift UBI 9 base image default user non-root
💡 Result:
- UBI 9 “base OS” images (e.g.,
ubi9/ubi,ubi9/ubi-minimal) do not inherently guarantee a non-root default user. In general, if an image doesn’t setUSER, the container runs as root (UID 0) by default, so you should explicitly set a non-rootUSERin your Dockerfile/Containerfile if you need a deterministic non-root user. [1][2] - Many Red Hat UBI runtime images (language/runtime stacks) already switch to a non-root user named
default. If you build FROM one of those, you’ll often inherit a non-root default user. [1] - On OpenShift (with the default/restricted SCC behavior), the platform typically overrides the image’s requested user and runs the container with an arbitrary non-root UID. So even if the UBI base image would run as root elsewhere, OpenShift usually forces non-root unless you use an SCC like
anyuid/special permissions. [3]
Sources:
[1] Red Hat Developer – Best practices (run as non-root; mentions UBI runtime images set non-root default) (developers.redhat.com)
[2] Example guidance noting default root when no USER is set (production-gitops.dev)
[3] OpenShift Cookbook – OpenShift overrides image UID; recommends arbitrary UID compatibility (cookbook.openshift.org)
Citations:
- 1: https://developers.redhat.com/articles/2021/11/11/best-practices-building-images-pass-red-hat-container-certification?utm_source=openai
- 2: https://production-gitops.dev/guides/cp4i/mq/security/information/image/?utm_source=openai
- 3: https://cookbook.openshift.org/users-and-role-based-access-control/how-can-i-enable-an-image-to-run-as-a-set-user-id.html?utm_source=openai
Explicitly set a non-root user in both stages to satisfy DS-0002.
The Dockerfile has no USER directive, so the container inherits the default user from the base images. Since registry.ci.openshift.org/ocp/4.22:base-rhel9 is a base OS image (not a runtime image) and does not guarantee a non-root default user, the image will default to root (UID 0) unless the base image is verified to have a non-root USER already configured.
Add an explicit USER directive to the final stage (line 8 onward) pointing to a non-root user/UID, or confirm via image inspection that the base image provides a non-root default.
🧰 Tools
🪛 Trivy (0.69.1)
[error] 1-1: Image user should not be 'root'
Specify at least 1 USER command in Dockerfile with non-root user as argument
Rule: DS-0002
(IaC/Dockerfile)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Dockerfile.rhel7` at line 1, The Dockerfile's stages (FROM
registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS
builder and the final image stage) do not set an explicit non-root user required
by DS-0002; inspect or choose a non-root username/UID available in the base
images and add an explicit USER directive in the final stage (and any
intermediate runtime stage if present) to switch from root to that non-root
account so the container does not run as UID 0.
|
@openshift-bot: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
@openshift-bot: An error was encountered searching for bug OCPBUGS-70012 on the Jira server at https://issues.redhat.com. No known errors were detected, please see the full error message for details. Full error message.
No response returned: Get "https://issues.redhat.com/rest/api/2/issue/OCPBUGS-70012": GET https://issues.redhat.com/rest/api/2/issue/OCPBUGS-70012 giving up after 5 attempt(s)
Please contact an administrator to resolve this issue, then request a bug refresh with DetailsIn response to this:
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. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
/close |
|
@wangke19: Closed this PR. DetailsIn response to this:
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. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-70012. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state. DetailsIn response to this:
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. |
Updating ose-cluster-kube-apiserver-operator-container image to be consistent with ART for 4.22
TLDR:
Product builds by ART can be configured for different base and builder images than corresponding CI
builds. This automated PR requests a change to CI configuration to align with ART's configuration;
please take steps to merge it quickly or contact ART to coordinate changes.
The configuration in the following ART component metadata is driving this alignment request:
ose-cluster-kube-apiserver-operator.yml.
Detail:
This repository is out of sync with the downstream product builds for this component. The CI
configuration for at least one image differs from ART's expected product configuration. This should
be addressed to ensure that the component's CI testing accurate reflects what customers will
experience.
Most of these PRs are opened as an ART-driven proposal to migrate base image or builder(s) to a
different version, usually prior to GA. The intent is to effect changes in both configurations
simultaneously without breaking either CI or ART builds, so usually ART builds are configured to
consider CI as canonical and attempt to match CI config until the PR merges to align both. ART may
also configure changes in GA releases with CI remaining canonical for a brief grace period to enable
CI to succeed and the alignment PR to merge. In either case, ART configuration will be made
canonical at some point (typically at branch-cut before GA or release dev-cut after GA), so it is
important to align CI configuration as soon as possible.
PRs are also triggered when CI configuration changes without ART coordination, for instance to
change the number of builder images or to use a different golang version. These changes should be
coordinated with ART; whether ART configuration is canonical or not, preferably it would be updated
first to enable the changes to occur simultaneously in both CI and ART at the same time. This also
gives ART a chance to validate the intended changes first. For instance, ART compiles most
components with the Golang version being used by the control plane for a given OpenShift release.
Exceptions to this convention (i.e. you believe your component must be compiled with a Golang
version independent from the control plane) must be granted by the OpenShift staff engineers and
communicated to the ART team.
Roles & Responsibilities:
tests OR that necessary metadata changes are reported to the ART team:
@release-artistsin
#forum-ocp-arton Slack. If necessary, the changes required by this pull request can beintroduced with a separate PR opened by the component team. Once the repository is aligned,
this PR will be closed automatically.
verify-depsis complaining. In that case, please opena new PR with the dependency issues addressed (and base images bumped). ART-9595 for reference.
any required labels to ensure the PR merges once tests are passing. In cases where ART config is
canonical, downstream builds are already being built with these changes, and merging this PR
only improves the fidelity of our CI. In cases where ART config is not canonical, this provides
a grace period for the component team to align their CI with ART's configuration before it becomes
canonical in product builds.
ART has been configured to reconcile your CI build root image (see https://docs.ci.openshift.org/docs/architecture/ci-operator/#build-root-image).
In order for your upstream .ci-operator.yaml configuration to be honored, you must set the following in your openshift/release ci-operator configuration file:
Change behavior of future PRs:
set up automatically. This means that such a PR would merge without human intervention (and awareness!) in the future.
To do so, open a PR to set the
auto_labelattribute in the image configuration. ExampleUPSTREAM: <carry>:. An example.If you have any questions about this pull request, please reach out to
@release-artistsin the#forum-ocp-artcoreos slack channel.