Repository navigation
chore: update Go to 1.27.4 and refresh dependencies - #706
Merged
Merged
Conversation
GO-2026-6859 -- an HTTP/1 server crash from a MaxBytesReader header race in net/http -- is present in go1.27.3 and fixed in go1.27.4. It is why Security Scan is red on main and on every open PR: govulncheck found it reachable from 26 call sites, including version.GetLatest, mke.GetClientBundle, configurer.downloadFile and helm.getChart. govulncheck now reports no vulnerabilities. go.mod's go directive moves to 1.27.4. CI follows automatically: every workflow resolves its toolchain with actions/setup-go's go-version-file: go.mod. Dependencies refreshed with go get -u ./..., notably Kubernetes 0.36.2 -> 0.37.2, Helm 3.21.4 -> 3.22.1, testify 1.11.1 -> 1.12.1 and logrus 1.9.4 -> 1.10.2. No launchpad source changed; the diff is go.mod and go.sum. One pin was necessary. go get -u took k8s.io/kube-openapi past what apimachinery 0.37.2 supports: the newer kube-openapi returns structured-merge-diff/v7 types while apimachinery 0.37.2 is built against v6, so managedfields failed to compile -- cannot use typeSchema.Types (variable of type []"sigs.k8s.io/structured-merge-diff/v7/schema".TypeDef) as []"sigs.k8s.io/structured-merge-diff/v6/schema".TypeDef kube-openapi is held at the version apimachinery 0.37.2 itself requires, which drops the duplicate v7 module from the graph. A future -u will reintroduce this; the fix is to move kube-openapi only when the k8s minor it belongs to moves. The rig replace directive is untouched and still wins: the require line reads v2.2.1 but go list resolves github.com/k0sproject/rig/v2 => github.com/james-nesbitt/rig/v2 v2.0.0-alpha.2.0.20260916132849-b534cbe07c9f, so the bump is inert and this PR does not change which rig is compiled. Verified: go build ./... clean, go vet clean, make lint 0 issues, make unit-test 0 failures, govulncheck no vulnerabilities. Written by AI: claude-opus-5 Signed-off-by: James Nesbitt <jnesbitt@mirantis.com>
3 tasks done
james-nesbitt
added a commit
that referenced
this pull request
Nov 12, 2026
* chore: drop the rig fork replace and build against rig v2.2.1
go.mod carried
replace github.com/k0sproject/rig/v2 =>
github.com/james-nesbitt/rig/v2 v2.0.0-alpha.2.0.20260916132849-b534cbe07c9f
introduced with the rig v2 migration (#651). The fork existed to carry
one fix: bounding winrm.(*command).Wait() and remotefs.(*winFile)
.command() against a silently dead WinRM session, seen as a 40+ minute
smoke-windows hang after a Windows host reboot during remotefs.Upload.
Upstream had not merged it, so the replace was the only way to get it.
Upstream has merged it since -- k0sproject/rig#473, issue #472 closed --
and released it. Verified by content rather than by commit SHA, which is
why this was missed before: upstream merged a rebased commit, so the
fork's SHA is not an ancestor of upstream main and an ancestry check
reports the fix as absent when it is present. In remotefs/winfile.go,
commandTimeout and errRcpTimeout appear 0 times at v2.1.0 and 14 times
at v2.2.1, and v2.2.1's command.Wait() carries the ctx race the fork
added.
#706 bumped the require line to v2.2.1 but the replace silently
discarded it; removing the replace is what actually moves rig.
Roughly fifty commits arrive with it. Beyond the WinRM hang fix, the
ones touching paths launchpad uses:
fix(ssh): honour StrictHostKeyChecking=yes instead of always accepting
fix(cmd,sudo): impose a POSIX shell instead of trusting $SHELL
fix(initsystem): don't let SysVinit match systemd hosts
fix(os): stop ResolveLinuxCompat claiming hosts os-release identifies
fix(remotefs): several ErrNotExist misclassifications in WinFS stat
feat(remotefs): atomic downloads, opt-in resume, HTTPHead
feat(winrm): export ErrAuthFailed, stop marking 401/403 non-retryable
Two of those overlap workarounds the migration added: launchpad builds
its own OS release registry via rig.WithOSReleaseProvider to drop the
compat fallback, and handles the 401/403 retry classification itself.
Both still compile and are left alone here -- whether they are now
redundant is a separate question from whether the update is safe.
Verified: go build ./... clean, make lint 0 issues, make unit-test 35
packages ok and 0 failures.
Not covered by unit tests: this is the host connectivity layer, so the
smoke suites are the real exercise. smoke-modern is labelled on the PR.
Written by AI: claude-opus-5
Signed-off-by: James Nesbitt <jnesbitt@mirantis.com>
* Drop the launchpad workarounds rig v2.2 makes redundant
Two migration-era workarounds overlapped fixes that arrived with v2.2.1.
One is now entirely upstream's; the other turned out to be only half
overlap, and the half that still earns its place is kept.
401/403 retry classification -- removed in full.
isTransientAuthError matched "http error 401" and three sibling shapes
by substring, because rig v2.1 wrapped a WinRM credential rejection in
ErrNonRetryable and this phase, whose whole job is waiting for hosts to
become reachable, abandoned a host on its first attempt. smoke-fips
regressed on exactly that.
rig v2.2 tags a rejection with protocol.ErrAuthFailed and deliberately
leaves it outside ErrNonRetryable, documenting the same reasoning:
"WinRM starts answering before authentication has been configured, and
sshd accepts connections before authorized_keys has been written".
shouldRetryConnect is now one line and the substring table is gone.
The test keeps its cases and moves them to the shapes rig produces now.
OS release registry -- kept, with its rationale corrected.
It was introduced for two reasons. The first is upstream's now: rig's
registry promoted the winning resolver to the front, letting
ResolveLinuxCompat -- which matches every Linux host -- overtake
ResolveLinux after a Windows host resolved, so mixed clusters
misreported Linux hosts as "linux". v2.2's ResolveLinuxCompat stands
down when os-release identifies the host, so ordering no longer decides
the outcome. TestOSRegistryOrderingIsStable now asserts that against
rig's own DefaultRegistry and passes.
The second reason stands, and dropping the registry regressed it --
caught by TestOSRegistryRejectsUnreadableOSRelease failing. Measured
against rig's default registry, a host with no readable os-release but
with apt-get resolves to ID "linux", IDLike ["debian"] rather than
erroring. Every matcher registered through configurer.RegisterOSModule
compares r.ID to an exact distribution name and none consults IDLike,
so that host matches no configurer and fails later, further from the
cause. The registry still excludes compat so the failure stays at
resolution as os.ErrNotRecognized.
Verified: go build ./... clean, make lint 0 issues, make unit-test 0
failures.
Written by AI: claude-opus-5
Signed-off-by: James Nesbitt <jnesbitt@mirantis.com>
---------
Signed-off-by: James Nesbitt <jnesbitt@mirantis.com>
james-nesbitt
added a commit
that referenced
this pull request
Nov 12, 2026
Brings in Go 1.27.4 (#706) and rig v2.2.1 (#707), which is what clears Security Scan on this branch. cluster_test.go conflicted. Both sides inserted a test function at the same anchor, and git split that single collision into two marker blocks by aligning the identical YAML prologue -- `return ` plus apiVersion through version: 3.3.7 -- that both new functions happen to share. A verbatim ours-then-theirs union of those blocks produces a function with two openers and one body. Resolved by reconstructing both functions whole from the three stages rather than splicing the marker regions: ours' TestAdminPasswordIsRequired and main's TestWinRMPasswordExposureWarning each get their own copy of the shared prologue and their own closing brace. A first attempt took main's file and inserted only ours' new function. That compiled, and it was wrong: this branch is not a pure insertion at file level -- it also adds adminPassword to 27 existing fixtures, and that edit was silently dropped. Twelve unrelated tests failed on the required tag, which is what exposed it. git merge-file over the three stages keeps those edits and reduces the conflict to the two genuine blocks. Four fixtures that arrived with main omit spec.mke.adminPassword and now fail validation, this branch having made it required: TestWinRMPasswordExposureWarning, ...IsPerHost, TestEmptyWinRMPasswordIsRejected and TestHostWithNoProtocolIsRejected. Each gains adminPassword: fake-admin-password, the same value and convention the branch already applied to the fixtures that predated it. TestAdminPasswordIsRequired's own fixture is deliberately left without one, since its absence is what that test asserts. Verified by counting removals rather than by a passing suite, because a wrong splice here compiles and passes both: diffing the merged file against each stage shows zero lines removed from ours and zero from theirs. make unit-test 0 failures, make lint 0 issues. Written by AI: claude-opus-5 Signed-off-by: James Nesbitt <jnesbitt@mirantis.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Go 1.27.3 → 1.27.4, plus
go get -u ./.... The diff isgo.mod,go.sumand a changelog entry — no launchpad source changed.Why now
Security Scanis red onmainand on every open PR.govulncheckflags GO-2026-6859, an HTTP/1 server crash from aMaxBytesReaderheader race innet/http, present ingo1.27.3and fixed ingo1.27.4. It was reachable from 26 call sites, including:After this change
govulncheck ./...reports no vulnerabilities.CI follows the
go.moddirective automatically — every workflow resolves its toolchain throughactions/setup-gowithgo-version-file: go.mod.Dependency refresh
k8s.io/*helm.sh/helm/v3github.com/sirupsen/logrusgithub.com/stretchr/testifygithub.com/creasty/defaultsgithub.com/go-playground/validator/v10github.com/segmentio/analytics-go/v3oras.land/oras-go/v2One pin was necessary
go get -utookk8s.io/kube-openapipast whatapimachinery0.37.2 supports. The newer kube-openapi returnsstructured-merge-diff/v7types while apimachinery 0.37.2 is built against v6, so both ended up in the graph andmanagedfieldsfailed to compile:kube-openapi is held at
v0.0.0-20260721132016-d427ff9ee9ad, the version apimachinery 0.37.2 itself requires, which drops the duplicate v7 module. Kustomize came back to 0.21.2 with it.A future
go get -uwill reintroduce this. kube-openapi should move only when the Kubernetes minor it belongs to moves.The rig replace is untouched
go.mod's require line for rig readsv2.2.1after the update, but the replace directive still wins:So the bump is inert and this PR does not change which rig is compiled. Worth knowing given k0sproject/rig#516 is in flight.
Testing
Not run: the smoke suites. This touches no runtime behaviour, but it does rebuild every binary CI produces, so a smoke label before merge is reasonable if you want the extra confidence.
Checklist
Written by AI: claude-opus-5