Repository navigation
chore(agent): build with Go 1.27 (MK8S-470) - #38
ezekiel-alexrod wants to merge 3 commits into
Conversation
Renovate bumps the go directive to 1.27.2 in #14, but the image still builds with golang:1.26 and fails with "go.mod requires go >= 1.27.2". The devcontainer and the docs move along. Refs: MK8S-470
Go 1.27 lets a composite literal set a promoted field directly, and the modernize embedlit check flags every literal that still names the embedded type (ObjectMeta, NamespacedName, Descriptor). Applied with golangci-lint --fix, no behaviour change. Refs: MK8S-470
There was a problem hiding this comment.
Why not modifying https://github.com/scality/platform-renovate ?
There was a problem hiding this comment.
You're right, it fits better there: scality/platform-renovate#47. I tested it with a local Renovate dry-run: a full golang:x.y.z tag without a digest is looked up as a Go release, so go.mod, the Dockerfile and the devcontainer land in one renovate/golang branch, with no annotation in the repo. Floating and digest-pinned tags keep the Docker lookup. I dropped the Renovate config from this PR, it only keeps the full tags now.
4ab3a5f to
1569e91
Compare
| { | ||
| "name": "Kubebuilder DevContainer", | ||
| "image": "golang:1.27", | ||
| "image": "golang:1.27.2", |
There was a problem hiding this comment.
missing renovate annotations
| FROM golang:1.27 AS builder | ||
| # Override BASE_IMAGE to build from another registry, e.g. | ||
| # docker.io/library/golang:<the Go version of go.mod> | ||
| ARG BASE_IMAGE=golang:1.27.2 |
1569e91 to
f311678
Compare
|
@anthony-treuillier-scality the images moved from |
The builder and devcontainer images use golang:1.27@sha256, like the other platform repos. The tag follows the Go minor, the digest brings each Go patch, and Renovate bumps both in the golang group, together with the go directive. Renovate dates a Docker tag by its last push, and the official golang images are rebuilt about once a week, so with a 7-day delay the image missed that group and #14 came without the Dockerfile. platform-renovate drops the delay for the golang image: the image goes first, and the directive, which keeps its delay, joins the same PR. The Dockerfile uses the BASE_IMAGE form of the kubebuilder v4.16 scaffold, so the next kubebuilder update has less to merge. Refs: MK8S-470
f311678 to
3da8c71
Compare
Component
agent, docs
Problem
Renovate bumps the
godirective to 1.27.2 in #14, but its CI can't pass. The image still builds withgolang:1.26(go.mod requires go >= 1.27.2), and Go 1.27 makes themodernizelinter flag every struct literal that names an embedded type. #14 came without the Dockerfile because Renovate dates a Docker tag by its last push: the officialgolangtags are pushed again at each rebuild, so they stay younger than our 7-dayminimumReleaseAge.Fix
Three commits, each one reads on its own. The second is mechanical, a quick scroll is enough.
go 1.27.2inagent/go.mod. CI and the RPM build already readgo-version-file. The docs now point toagent/go.modinstead of repeating a version.&corev1.Node{Name: n}). Fixed withgolangci-lint --fix, no behaviour change.golang:1.27@sha256), like the other platform repos. With scality/platform-renovate#47, the image no longer waits the 7-day delay, so the next bump movesgo.mod, the Dockerfile and the devcontainer in onerenovate/golangPR: the image first, the directive a week later. Nothing Renovate-specific stays in this repo.BASE_IMAGEform of the kubebuilder v4.16 scaffold, so the next kubebuilder update has less to merge.Better merged after scality/platform-renovate#47: before it, the next Go bump still leaves the images behind, as #14 did. Once merged, Renovate closes #14 by itself.
Test
make -C agent lint, Go 1.27.2make -C agent test, Go 1.27.2make -C agent docker-build,kustomize build config/defaultgo 1.26.0and Go 1.26.9unknown field Name in struct literal, as expectedmake -C agent test-e2eon kind, image built fromgolang:1.27@sha256(Go 1.27.3)renovate --platform=local --dry-run=lookup(44.167.7) with the preset of scality/platform-renovate#471.27.3pending its delay, both inrenovate/golangOut of scope
// +buildlines intest/e2e:make lintdoesn't build that tag.godirective follows patch releases (rangeStrategy: bumpinplatform-renovate).Relates-to: MK8S-470