Skip to content

chore(deps): drop k8s.io/kubernetes and bump k8s modules to v0.37.2 - #1333

Merged
mbevc1 merged 6 commits into
mainfrom
20261105_chore_go_deps
Nov 5, 2026
Merged

mbevc1 merged 6 commits into
mainfrom
20261105_chore_go_deps

Conversation

@mbevc1

@mbevc1 mbevc1 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Remove the k8s.io/kubernetes dependency, which was only used by one test helper, and bump the k8s modules to v0.37.2. Its unpublished v0.0.0 requirements forced a 32-line replace block that Dependabot cannot update, so the staging modules had drifted to v0.37.0 behind kubernetes v1.37.2.

Review notes

  • Test helper: e2epod.WaitForPodNameRunningInNamespace is replaced by waitForPodRunning in internal/kube/kube_test.go, a wait.PollUntilContextTimeout loop with the same semantics: 5 min timeout, retry not-found and transient API errors (timeout, 429, 503), stop early on Succeeded/Failed, fail fast on any other error.
  • Module graph: 53 modules leave go.mod (ginkgo, prometheus, cel-go, kustomize, otel exporters, …). No remaining module changes version; the client-go require now states v0.37.2, which the replace already selected. go list -m all resolves again.

Checklist

@github-actions github-actions Bot added the go Pull requests that update go code label Nov 5, 2026
@claude

claude Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @mbevc1's task in 25s —— View job


Follow-up review: commits be65f8b..6aaf4c4

  • Gather prior review findings
  • Diff BEFORE..AFTER and classify changes
  • Check status of each previously raised finding touched by new commits
  • Flag new bugs/security/regressions in changed lines only
  • Post summary comment

What changed in this range: 6aaf4c48 is a merge of main into this branch, pulling in 4f90bb6b (chore(deps): bump github.com/Azure/azure-sdk-for-go/sdk/azcore #1335). The only diff is in go.mod/go.sum (azcore 1.23.3→1.24.0 and a few transitive bumps). internal/kube/kube_test.go is unchanged in this range.

Status of previously raised findings: none are touched by these commits — kube_test.go wasn't modified, so all three prior findings remain in the state reported in the last review (all three resolved as of 7d8a9fd).

New issues in the changed lines (be65f8b..6aaf4c4): 0. The diff is an unrelated, mechanical dependency bump merged in from main; nothing to flag.

@github-actions github-actions Bot added the chore label Nov 5, 2026
Comment thread internal/kube/kube_test.go Resolved
Comment thread internal/kube/kube_test.go Resolved
@mbevc1
mbevc1 force-pushed the 20261105_chore_go_deps branch from 7001be1 to f1fa5c7 Compare November 5, 2026 15:53
@mbevc1
mbevc1 marked this pull request as ready for review November 5, 2026 15:53
@mbevc1
mbevc1 enabled auto-merge (squash) November 5, 2026 15:54
Comment thread internal/kube/kube_test.go Resolved
@mbevc1
mbevc1 disabled auto-merge November 5, 2026 16:03
@claude

claude Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up review: commits f1fa5c7..7d8a9fd

Status of previous findings:

  1. suite.clientset.CoreV1() → suite.clientset.Clientset.CoreV1() consistency nit — ✅ Resolved (applied in 7001be1; current code at kube_test.go:392 uses the promoted-field form consistently).
  2. Missing IsServerTimeout/connection-reset/EOF retries — ✅ Resolved (applied in 7001be1; kube_test.go:394-396 now retries IsServerTimeout, utilnet.IsConnectionReset, and utilnet.IsProbableEOF alongside the original checks).
  3. Timeout error lacks last observed phase/error for diagnostics — ✅ Resolved in the latest commit (7d8a9fd). lastPhase/lastErr are now tracked across polls and wrapped into the returned error once the 5-minute deadline has passed, with the deadline detected by comparing against ctx.Deadline() directly (since client-go's rate limiter can fail the final Get with an error that doesn't wrap context.DeadlineExceeded). Verified against a fake API server per the author's own testing note.

New inline comments on the changed lines (f1fa5c7..7d8a9fd): 0

I reviewed the new waitForPodRunning diagnostics logic (internal/kube/kube_test.go:386-419) for correctness/regressions. The deadline-vs-error precedence looks right: terminal-phase errors and non-retryable Get errors still propagate immediately with their original message when well before the deadline, and the "not Running before the deadline" wrapper only kicks in once time.Now() is at/after the computed deadline. lastPhase/lastErr are only read/written synchronously inside the single polling goroutine, so there's no data race. "PR checks" on this run passed, confirming the new code compiles and lints cleanly.

All three previously raised findings are resolved and no new issues were found in the changed lines.

k8s.io/kubernetes is at v1.37.2 but the replace block pinned every
k8s.io staging module to v0.37.0, so the build mixed two patch releases.
Dependabot only edits require lines, so its k8s bumps were silently
overridden by the replace block.
k8s.io/kubernetes was imported for a single test helper,
WaitForPodNameRunningInNamespace. Its go.mod requires the k8s.io
staging modules at the unpublished v0.0.0, which forced a 32-line
replace block and left `go list -m all` unresolvable
(k8s.io/cri-streaming has no published version).

The helper is replaced by a wait.PollUntilContextTimeout loop with the
same semantics: 5 minute timeout, retry while the pod is missing, stop
early on a terminal phase. This removes the replace block and 53
modules from the graph. The client-go require now states v0.37.2, the
version the replace was already selecting.
waitForPodRunning retried every Get error, so a permanent failure such
as a 403 polled for the full 5 minutes and surfaced only "context
deadline exceeded". It now retries only not-found and transient errors
(timeout, 429, 503) and returns anything else immediately, matching
the e2e framework helper it replaced.
…for a pod

A 504 server timeout, a connection reset or an unexpected EOF from the
API server failed the wait on the first poll, so a single transient
blip could fail the whole KubeTestSuite. These are now retried like the
other transient errors.

Also call CoreV1 through suite.clientset.Clientset, as the rest of the
file does.
A timed-out wait returned a bare "context deadline exceeded", which
does not say whether the pod was stuck in Pending (for example on an
image pull) or the API kept returning transient errors. The error now
includes the last observed phase and the last retried error.

The timeout is detected by comparing against the deadline rather than
with wait.Interrupted: when the final poll races the deadline,
client-go's rate limiter fails the Get with an error that does not
wrap context.DeadlineExceeded.
@mbevc1
mbevc1 force-pushed the 20261105_chore_go_deps branch from f2b6c19 to be65f8b Compare November 5, 2026 16:15
@mbevc1
mbevc1 enabled auto-merge (squash) November 5, 2026 16:20
@mbevc1
mbevc1 merged commit 315728e into main Nov 5, 2026
21 checks passed
@mbevc1
mbevc1 deleted the 20261105_chore_go_deps branch November 5, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants