OCPBUGS-87352: Updating coredns-container image to be consistent with ART for 5.0#187
Conversation
|
Created by ART pipeline job run https://art-jenkins.apps.prod-stable-spoke1-dc-iad2.itup.redhat.com/job/aos-cd-builds/job/build%252Fsync-ci-images/201 |
WalkthroughUpdates CI operator and Dockerfile base images from OpenShift 4.22 with Go 1.25 to OpenShift 5.0 with Go 1.26. Both builder and runtime environments are bumped to the newer versions. ChangesBuild Infrastructure Upgrade
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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-87352, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
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-87352, 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: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Dockerfile.ocp (1)
1-14: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winMissing HEALTHCHECK directive.
The Dockerfile does not define a
HEALTHCHECKdirective. Per coding guidelines, containers should include health checks to enable orchestrators to monitor container health and restart failed instances.🏥 Proposed fix to add HEALTHCHECK
ENTRYPOINT ["/usr/bin/coredns"] +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD ["/usr/bin/coredns", "-health", "localhost:8080"] || exit 1 + LABEL io.k8s.display-name="CoreDNS" \ io.k8s.description="CoreDNS delivers the DNS and Discovery Service for a Kubernetes cluster." \ maintainer="dev@lists.openshift.redhat.com"Note: Adjust the health check endpoint and port based on CoreDNS's actual health check configuration.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Dockerfile.ocp` around lines 1 - 14, Add a HEALTHCHECK directive to the Dockerfile so the container runtime can monitor the /usr/bin/coredns process; update the Dockerfile (near the ENTRYPOINT or after copying the coredns binary) to include a HEALTHCHECK that periodically probes CoreDNS's health endpoint (use curl/HTTP or an exec probe against the coredns health path and return non-zero on failure) and set sensible options (interval, timeout, start-period, retries). Ensure the probe targets the correct endpoint/port for CoreDNS and fails the container when the check does not succeed.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.ci-operator.yaml:
- Line 4: Choose the intended Go toolchain (e.g., Go 1.26) and make all
references match: update the .go-version file to the chosen version, update the
.ci-operator.yaml tag value (the rhel-*-golang-<version>-openshift-* token) to
the same Go version, and update the go directive in go.mod (the "go X.Y.Z" line)
to that same version; verify the Makefile's GOLANG_VERSION variable
(GOLANG_VERSION ?= $(shell cat .go-version)) remains consistent with .go-version
so CI, local builds and go.mod all use the identical Go toolchain.
In `@Dockerfile.ocp`:
- Line 3: The Dockerfile currently uses a broad COPY . . which pulls the entire
build context into the image; change this to explicitly copy only the files and
directories required for the build (e.g., copy the Dockerfile, module files, and
the source directories needed by the build stage) instead of COPY . ., updating
the Dockerfile's build stage(s) to list those specific paths so unnecessary
artifacts like .git, docs, and tests are excluded from the image.
- Around line 6-9: The Dockerfile currently leaves the container running as root
(ENTRYPOINT ["/usr/bin/coredns"])—add a non-root user and switch to it: create
or choose a non-root user/group (e.g., coredns or numeric UID/GID), ensure
/usr/bin/coredns is owned/executable by that user (chown/chmod in the image
build stage), and add a USER directive (USER <user> or USER <uid>:<gid>) before
the ENTRYPOINT so the container does not run as root.
---
Outside diff comments:
In `@Dockerfile.ocp`:
- Around line 1-14: Add a HEALTHCHECK directive to the Dockerfile so the
container runtime can monitor the /usr/bin/coredns process; update the
Dockerfile (near the ENTRYPOINT or after copying the coredns binary) to include
a HEALTHCHECK that periodically probes CoreDNS's health endpoint (use curl/HTTP
or an exec probe against the coredns health path and return non-zero on failure)
and set sensible options (interval, timeout, start-period, retries). Ensure the
probe targets the correct endpoint/port for CoreDNS and fails the container when
the check does not succeed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 95fc9699-2600-429f-b06c-6d8fb8f9f5c0
📒 Files selected for processing (2)
.ci-operator.yamlDockerfile.ocp
| name: release | ||
| namespace: openshift | ||
| tag: rhel-9-release-golang-1.25-openshift-4.22 | ||
| tag: rhel-9-release-golang-1.26-openshift-5.0 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check Go version consistency across repo configuration files
echo "=== Checking .go-version ==="
cat .go-version
echo -e "\n=== Checking Makefile Go version reference ==="
rg -n "GOLANG_VERSION|go-version" Makefile
echo -e "\n=== Checking GitHub Actions Go version usage ==="
rg -n "go-version|GO_VERSION" .github/workflows/
echo -e "\n=== Checking if Go 1.26 compatibility is documented ==="
rg -n "1\.26|golang.*1\.26" --type mdRepository: openshift/coredns
Length of output: 7156
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== .ci-operator.yaml ==="
ls -l .ci-operator.yaml
cat -n .ci-operator.yaml
echo -e "\n=== Makefile: lines around GOLANG_VERSION ==="
sed -n '1,80p' Makefile
echo -e "\n=== Makefile occurrences of GOLANG_VERSION ==="
rg -n "GOLANG_VERSION" Makefile
echo -e "\n=== Check for setup-go / go-version usage in workflows ==="
for f in .github/workflows/*.yml; do
echo -e "\n--- $f ---"
rg -n "setup-go|go-version:" "$f" || true
done
echo -e "\n=== Check go.mod Go version (if present) ==="
if [ -f go.mod ]; then
rg -n "^go " go.mod || true
fiRepository: openshift/coredns
Length of output: 2898
Fix Go toolchain version mismatch between CI operator image and repository/tooling config
.ci-operator.yamluses a Go 1.26 build root image (tag: rhel-9-release-golang-1.26-openshift-5.0), while.go-versionpins Go1.24.6.- GitHub Actions installs the Go version from
.go-version(viaGO_VERSION=$(cat .go-version)andactions/setup-gowithgo-version: ${{ env.GO_VERSION }}) in workflows like.github/workflows/go.test.yml,golangci-lint.yml,make.doc.yml, andgo.coverage.yml. - The
MakefiledefinesGOLANG_VERSION ?= $(shell cat .go-version)but doesn’t appear to use it elsewhere; it will build/test with whatever Go is available in the environment. go.moddeclaresgo 1.25.0, adding a third Go-version reference.
Align .ci-operator.yaml, .go-version, and (as appropriate) the go.mod go directive so all build/test paths use the intended Go toolchain.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.ci-operator.yaml at line 4, Choose the intended Go toolchain (e.g., Go
1.26) and make all references match: update the .go-version file to the chosen
version, update the .ci-operator.yaml tag value (the
rhel-*-golang-<version>-openshift-* token) to the same Go version, and update
the go directive in go.mod (the "go X.Y.Z" line) to that same version; verify
the Makefile's GOLANG_VERSION variable (GOLANG_VERSION ?= $(shell cat
.go-version)) remains consistent with .go-version so CI, local builds and go.mod
all use the identical Go toolchain.
|
@openshift-bot: all tests passed! 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. |
|
ART wants to connect issue OCPBUGS-87639 to this PR, but found it is currently hooked up to ['OCPBUGS-87352']. Please consult with #forum-ocp-art if it is not clear what there is to do. |
|
/unassign @Thealisyed |
|
@gcs278: GitHub didn't allow me to assign the following users: aswinsuryan. Note that only openshift members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. 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. |
|
/assign @aswinsuryan |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-87352, 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 |
|
@aswinsuryan: 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-87352. The bug has been updated to no longer 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. |
Updating coredns-container image to be consistent with ART for 5.0
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:
coredns.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
in
#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 in the
#forum-ocp-artSlack channel.