-
Notifications
You must be signed in to change notification settings - Fork 157
OCPBUGS-87343: Updating golang-github-openshift-oauth-proxy-container image to be consistent with ART for 5.0 #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| build_root_image: | ||
| name: release | ||
| namespace: openshift | ||
| tag: rhel-9-release-golang-1.25-openshift-4.22 | ||
| tag: rhel-9-release-golang-1.26-openshift-5.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder | ||
| FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder | ||
| WORKDIR /go/src/github.com/openshift/oauth-proxy | ||
| COPY . . | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win Avoid copying entire context; specify needed files. The guideline requires "COPY specific files, not entire context." Consider copying only the files needed for the build (e.g., go.mod, go.sum, source directories). 📋 Suggested refinement-COPY . .
+COPY go.mod go.sum ./
+COPY cmd/ ./cmd/
+COPY pkg/ ./pkg/
+# Add other specific source directories as neededAs per coding guidelines: "COPY specific files, not entire context" from container security guidelines for 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| RUN go build . | ||
|
|
||
| FROM registry.ci.openshift.org/ocp/4.22:base-rhel9 | ||
| FROM registry.ci.openshift.org/ocp/5.0:base-rhel9 | ||
| COPY --from=builder /go/src/github.com/openshift/oauth-proxy/oauth-proxy /usr/bin/oauth-proxy | ||
| ENTRYPOINT ["/usr/bin/oauth-proxy"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/oauth-proxy
Length of output: 282
🏁 Script executed:
Repository: openshift/oauth-proxy
Length of output: 447
🏁 Script executed:
Repository: openshift/oauth-proxy
Length of output: 1375
🌐 Web query:
What is the purpose/content of the OpenShift CI image tagregistry.ci.openshift.org/ocp/5.0:base-rhel9(is it UBI minimal, minimal, distroless, or something else)?💡 Result:
The image tag registry.ci.openshift.org/ocp/5.0:base-rhel9 (often referred to as
base-rhel9) serves as a foundational Red Hat Enterprise Linux 9-based image used for building and running various OpenShift components within the OpenShift CI environment [1][2]. It is not a "distroless" image, nor is it strictly defined as "minimal" or "UBI minimal" by that specific naming convention. Instead, it is an OpenShift-specific base image—commonly known asopenshift-enterprise-base-rhel9—maintained by the OpenShift Automated Release Team (ART) [3]. It is designed to be the consistent, enterprise-grade RHEL 9 base layer that downstream OpenShift component images use as their parent (viaFROMinstructions in Dockerfiles) to ensure consistency across the product [1][3][2]. Key points regarding its purpose and content: - Base Layer: It provides the required RHEL 9 user-space environment, shared libraries, and core configuration that OpenShift binaries require to run, replacing the older RHEL 8-based base images [1][3]. - Component Building: It is used as the starting point for creating various OpenShift service images (e.g., the installer image) [2]. - Standardized Maintenance: The image is managed to remain consistent with downstream product builds, ensuring that CI testing environment reflects the production environment customers will receive [3]. In the context of the OpenShift CI ecosystem, it is effectively the RHEL 9 iteration of the standard OpenShift base image [1]. While it shares common traits with minimal RHEL/UBI images, its specific identity in theocpnamespace is as the authorized, synchronized base for OpenShift product components [1][3].Citations:
🌐 Web query:
What is the purpose/content of the OpenShift CI builder image tagregistry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0?💡 Result:
The image tag registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 is a specialized container image used as a build environment within the OpenShift CI (Continuous Integration) infrastructure [1][2]. Its primary purpose is to provide a standardized, controlled toolchain for building OpenShift Container Platform (OCP) components [1]. By referencing this image in the FROM directive of a Dockerfile (or as a build_root_image in ci-operator configuration), developers ensure that their software is compiled using a specific, tested version of the Go programming language (in this case, Go 1.26) on a RHEL 9 base, consistent with the requirements of OpenShift version 5.0 [1][2]. The components of the tag indicate its specific configuration [1]: - rhel-9: Indicates the underlying Red Hat Enterprise Linux 9 operating system used in the image [1]. - golang-1.26: Specifies that the image includes Go version 1.26 [1]. - openshift-5.0: Identifies that this builder image is aligned with the OpenShift 5.0 release stream [1]. These images are managed by the OpenShift Architecture and Release Team (ART) [1]. When the required Go version or base OS for OpenShift changes, ART updates the central build configuration, and automation propagates these changes across the various component repositories by updating their build manifests [1]. Users are generally expected to use these officially provided builder images rather than custom ones to ensure compatibility with the OCP build environment and release processes [1][3].
Citations:
Base image registry/type don’t meet container security guidelines
Dockerfilepulls both build and runtime images fromregistry.ci.openshift.org(ocp/builder...andocp/5.0:base-rhel9), not fromcatalog.redhat.comas required by the guidelines.base-rhel9is an OpenShift enterprise RHEL9 base layer (“openshift-enterprise-base-rhel9”), not a UBI minimal or distroless image, so the runtime stage doesn’t satisfy the “UBI minimal or distroless” requirement.🧰 Tools
🪛 Trivy (0.69.3)
[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
Learn more
(IaC/Dockerfile)
🤖 Prompt for AI Agents
Source: Coding guidelines