Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci-operator.yaml
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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 md

Repository: 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
fi

Repository: openshift/coredns

Length of output: 2898


Fix Go toolchain version mismatch between CI operator image and repository/tooling config

  • .ci-operator.yaml uses a Go 1.26 build root image (tag: rhel-9-release-golang-1.26-openshift-5.0), while .go-version pins Go 1.24.6.
  • GitHub Actions installs the Go version from .go-version (via GO_VERSION=$(cat .go-version) and actions/setup-go with go-version: ${{ env.GO_VERSION }}) in workflows like .github/workflows/go.test.yml, golangci-lint.yml, make.doc.yml, and go.coverage.yml.
  • The Makefile defines GOLANG_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.mod declares go 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.

4 changes: 2 additions & 2 deletions Dockerfile.ocp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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/coredns/coredns
COPY . .
Comment thread
coderabbitai[bot] marked this conversation as resolved.
RUN GO111MODULE=on GOFLAGS=-mod=vendor go build -o coredns .

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/coredns/coredns/coredns /usr/bin/

ENTRYPOINT ["/usr/bin/coredns"]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Expand Down