Skip to content

chore: update all dependencies to latest versions - #997

Merged
k8s-ci-robot merged 5 commits into
kubernetes-sigs:masterfrom
bryantbiggs:deps/update-all-modules-2026-03-16
Mar 16, 2026
Merged

chore: update all dependencies to latest versions#997
k8s-ci-robot merged 5 commits into
kubernetes-sigs:masterfrom
bryantbiggs:deps/update-all-modules-2026-03-16

Conversation

@bryantbiggs

@bryantbiggs bryantbiggs commented Mar 16, 2026

Copy link
Copy Markdown
Member

This PR brings the entire repository up to date β€” Go toolchain, all module dependencies, Docker base images, and GitHub Actions β€” and takes the opportunity to resolve several long-standing structural problems in the test infrastructure that have made the project harder to maintain and contributed to the dependency debt in the first place.

Why this matters

The k8s.io/kubernetes monorepo problem (and why it kept coming back)

The root cause of the stale dependency situation was a structural one: both test modules depended on k8s.io/kubernetes, the full Kubernetes monorepo. That single dependency dragged in 29–32 replace directives per module, all of which had to be kept manually in sync with each other and with the monorepo version. Every time any of those packages released a new version, the replace directives would fall out of sync and go mod tidy would either fail or produce an inconsistent module graph. This is why Dependabot PRs in this repo tend to stack up β€” updating one group of deps often conflicts with the replace directive web.

This PR removes k8s.io/kubernetes from both test modules entirely. The e2e module goes from 114 lines and 29 replace directives to 65 lines and zero. The integration module goes from 201 lines and 32 replace directives to 95 lines and zero. Future dependency updates β€” whether manual or via Dependabot β€” will be straightforward.

The integration tests weren't actually testing the auth webhook

The integration tests existed to verify that the IAM authentication webhook works end-to-end: a client presents a token, the kube-apiserver calls the webhook, the webhook calls STS, and access is granted or denied based on the IAM role mapping. That flow was silently broken.

The root cause: execRestCfg (the client config used to test IAM-authenticated access) had both TLSClientConfig.CertData and ExecProvider set simultaneously. When both are present, client-go uses mTLS β€” the client certificate satisfies authentication before the webhook is ever called. The ExecProvider (which invokes aws-iam-authenticator token) was ignored entirely. The tests were passing because the client cert auth succeeded, not because the IAM webhook worked.

This PR fixes that by clearing the cert fields from execRestCfg before attaching the ExecProvider. The webhook is now actually exercised on every test run β€” STS calls are visible in the test output, and the test correctly fails with "identity is not mapped" when a valid AWS role is not configured, as expected.

The go:linkname hack is gone

The old integration test framework used //go:linkname startEtcd k8s.io/kubernetes/test/integration/framework.startEtcd to call an unexported function in the monorepo. This was fragile (any internal refactor of the monorepo would silently break it), relied on unsafe, and was the primary reason k8s.io/kubernetes couldn't be removed. The migration to sigs.k8s.io/controller-runtime/pkg/envtest eliminates this entirely β€” envtest is the standard, supported way to run integration tests against a real kube-apiserver in the Kubernetes ecosystem.

go.work for clean multi-module management

The three Go modules in this repo (root, tests/e2e, tests/integration) previously relied on replace directives to reference each other locally. go.work is the idiomatic solution for this since Go 1.18 β€” it handles cross-module references at the workspace level without polluting individual go.mod files. go.work.sum is committed so the workspace is immediately usable after git clone with no extra setup.

What changed

Dependencies

  • Go toolchain: 1.25.7 β†’ 1.26.1
  • k8s.io/*: β†’ v0.35.2 across all modules
  • AWS SDK v2: all packages updated to latest
  • All other direct dependencies updated to latest compatible versions
  • Docker: go-runner eks-1-34 β†’ eks-1-35, minimal-base-nonroot β†’ 2026-03-10
  • GitHub Actions: checkout v5β†’v6, golangci-lint-action v9.0β†’v9.2 (linter v2.4β†’v2.11), goreleaser-action v6β†’v7

Test infrastructure

  • k8s.io/kubernetes removed from tests/e2e/go.mod and tests/integration/go.mod
  • All replace directives removed (was 29 in e2e, 32 in integration)
  • go.work added at repo root; go.work* removed from .gitignore
  • Integration tests migrated to controller-runtime/pkg/envtest
  • Integration test auth flow fixed (ExecProvider now actually used)
  • Server and healthz ports allocated dynamically in tests (no more hardcoded 21362/21363 risk under parallel execution)
  • config.Config.HealthPort field added; server.Run uses it with a default of 21363 (fully backward compatible)
  • os.MkdirTemp error handling fixed
  • context.TODO() β†’ context.Background() in server initialization
  • testEnv.Stop() errors logged rather than suppressed
  • setup-envtest pinned to 1.35.0 for reproducible binary downloads

Running the integration tests locally

# One-time setup
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
export KUBEBUILDER_ASSETS=$(setup-envtest use 1.35.0 -p path)

# Build the authenticator binary
make bin/aws-iam-authenticator

# Run
go test -v -run TestServer ./tests/integration/server/ \
  -authenticator-binary-path=./_output/bin/aws-iam-authenticator \
  -test-artifacts-dir=/tmp/iam-auth-integration-test \
  -role-arn=<AWS_ROLE_ARN>

Resolves

Resolves #996
Resolves #993
Resolves #992
Resolves #991
Resolves #989
Resolves #987
Resolves #984

Test plan

  • go test ./pkg/... β€” 157 tests, 33 packages, all passing
  • go build ./... clean across all three modules
  • go vet ./... clean
  • golangci-lint run clean
  • Integration tests pass with valid AWS credentials and role ARN

- Go 1.25.7 β†’ 1.26.1 (.go-version, all go.mod files)
- go get -u all direct/indirect Go module dependencies
- k8s.io/* v0.35.0 β†’ v0.35.2 across all modules
- actions/checkout v5 β†’ v6
- goreleaser/goreleaser-action v6 β†’ v7
- golangci/golangci-lint-action v9.0.0 β†’ v9.2.0
- golangci-lint tool v2.4.0 β†’ v2.11.3
- Dockerfile: golang image 1.25.7 β†’ 1.26.1
- Dockerfile: go-runner eks-1-34 β†’ eks-1-35
- Dockerfile: eks-distro-minimal-base-nonroot updated to 2026-03-10 tag
Replace the k8s.io/kubernetes monorepo dependency in both test modules
with lighter, purpose-built alternatives:

e2e module:
- Drop k8s.io/kubernetes/test/e2e/framework scaffolding
- Replace with direct ginkgo v2 + client-go calls
- Remove all 29 replace directives (framework was sole driver)
- go.mod: 114 β†’ 65 lines

integration module:
- Drop k8s.io/kubernetes in-process server + go:linkname hack
- Replace framework.StartTestServer with envtest.Environment
- Write admin kubeconfig via clientcmd using client cert auth
- Simplify TestMain (etcd lifecycle now managed by envtest)
- Remove all 32 replace directives, keep only local module replace
- go.mod: 201 β†’ 95 lines
Integration tests (testutils/testserver.go):
- Fix exec client silently bypassing IAM auth: nil out cert fields
  before setting ExecProvider so the webhook is actually exercised
- Replace hardcoded 1.29.5 envtest binary path with envtestBinaryPath()
  helper that checks KUBEBUILDER_ASSETS, falls back to setup-envtest
  use 1.35, and skips with instructions if neither is available
- Replace deprecated wait.PollImmediate with PollUntilContextTimeout

E2e tests (suite_test.go):
- Move flag.Parse() from init() into a new TestMain; remove testing.Init()
- Remove deprecated rand.Seed (Go 1.20+ auto-seeds global rand)
- Replace deprecated RunSpecsWithDefaultAndCustomReporters with RunSpecs
  and a ReportAfterSuite hook using reporters.GenerateJUnitReport

Go workspace:
- Add go.work covering root, tests/e2e, tests/integration
- Remove go.work* from .gitignore (go.work must be committed since
  tests/integration relies on it to resolve the local root module)
- Remove now-redundant replace directive from tests/integration/go.mod
- go work sync pulled ginkgo/gomega into root go.mod as indirect deps

.gitignore: add integration test server runtime artifacts
- Add HealthPort to config.Config; server.Run uses it (defaults to 21363)
- Allocate authenticator server and healthz ports dynamically via freePort()
  to avoid conflicts when multiple test processes run in parallel
- Fix MkdirTemp error being silently ignored in testConfig
- Replace context.TODO() with context.Background() in server.New call
- Replace //nolint:errcheck on testEnv.Stop() with t.Logf for observability
- Pin setup-envtest version to 1.35.0 for reproducible binary downloads
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 16, 2026
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 16, 2026
@bryantbiggs
bryantbiggs force-pushed the deps/update-all-modules-2026-03-16 branch from 0f9edd9 to 9f0a519 Compare March 16, 2026 15:50
…ld selector

Also fix govulncheck-action for fork PRs by setting repo-checkout: false;
the action's internal checkout conflicts with the explicit checkout step
when the PR originates from a fork, causing a duplicate Authorization header.

Also fix e2e run script: remove -gce-zone flag (was registered by the old
k8s.io/kubernetes framework, which is no longer a dependency) and update
ginkgo install to v2 to match the test suite.
@bryantbiggs
bryantbiggs force-pushed the deps/update-all-modules-2026-03-16 branch from 9f0a519 to 1d65eba Compare March 16, 2026 17:06
@bryantbiggs

Copy link
Copy Markdown
Member Author

cc @kmala - I know its a big PR ( apologies) but it cleans up a number of outdated modules and practices which should resolve most open PRs and make maintenance easier going forward

@kmala

kmala commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Thanks a lot for this @bryantbiggs
I was making changes to fix few lint issues but this is more exhaustive and future proof.
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 16, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryantbiggs, kmala

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2026
@k8s-ci-robot
k8s-ci-robot merged commit 540c0af into kubernetes-sigs:master Mar 16, 2026
9 checks passed
@bryantbiggs
bryantbiggs deleted the deps/update-all-modules-2026-03-16 branch March 16, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants