Skip to content

Drop containerd by moving to helm v3.21.3 - #5174

Closed
dimitri-nicolo wants to merge 1 commit into
release-v1.41from
dimitri-helm-3.21.3-drop-containerd-v1.41
Closed

Drop containerd by moving to helm v3.21.3#5174
dimitri-nicolo wants to merge 1 commit into
release-v1.41from
dimitri-helm-3.21.3-drop-containerd-v1.41

Conversation

@dimitri-nicolo

Copy link
Copy Markdown
Contributor

Description

Cherry-pick of master's 3fce8aca0 ("chore(deps): bump helm to v3.21.3 and oras-go to v2.6.2 to drop vulnerable containerd", #5100), to remove containerd from the operator on this branch instead of bumping it again.

containerd isn't used here. It arrives via pkg/render/istio → helm's pkg/action → helm's OCI pkg/registrycontainerd/remotes. That render code only uses helm as a local template renderer — it never contacts a registry — but pkg/action imports pkg/registry unconditionally, so containerd is linked into the binary on a path nothing can reach. helm v3.21.3 swapped containerd for oras-go/v2, so moving to it drops containerd entirely.

This branch is the furthest behind of the three, so this is the heaviest of the set. Reviewers should weigh it on that basis rather than by analogy to the v1.42 pick.

1. It needs a Go toolchain lift

helm v3.21.3 declares go 1.26.0; this branch builds with Go 1.25.7, so go mod tidy refuses outright:

helm.sh/helm/v3@v3.21.3 requires go >= 1.26.0 (running go 1.25.7; GOTOOLCHAIN=local)

There is no way around this by picking a lower helm — v3.21.3 is the only containerd-free release, and everything from v3.21.1 up requires Go 1.26:

helm go directive containerd in go.mod
v3.20.0 – v3.21.0 1.25.0 yes
v3.21.1, v3.21.2 1.26.0 yes
v3.21.3 1.26.0 no

GO_BUILD_VER and the build image do not change. Instead CONTAINERIZED gains one line — -e GOTOOLCHAIN=go1.26.4+auto — letting the container fetch the newer toolchain, and go.mod's directive moves to go 1.26.0. This is the same arrangement release-v1.40 already runs (it builds with the Go 1.25.12 image and a go 1.26.5 directive), so it's an established pattern on a release branch, not a new one.

2. It's a two-minor k8s jump

helm v3.21.3 requires client-go v0.36.2, and controller-runtime has to move with it:

before after
helm v3.19.5 v3.21.3
controller-runtime v0.22.5 v0.24.1
k8s.io/{api,client-go,apimachinery,apiserver,apiextensions-apiserver,kube-aggregator} v0.34.3 v0.36.2
oras-go/v2 v2.6.0 v2.6.2
containerd v1.7.29 + 3 more gone

oras-go goes to v2.6.2 rather than the v2.6.1 tidy selects, to match the CVE-2026-50151 / CVE-2026-50163 pin the other branches carry.

These can't be split into separate buildable commits: k8s.io/api v0.36 removed scheduling/v1alpha1, which helm v3.19.5's k8s.io/kubectl still imports, and controller-runtime v0.22.5 doesn't support client-go v0.36.

Verified

  • go build ./... passes under Go 1.26.4. No code changes were needed, despite the two-minor controller-runtime jump.
  • containerd drops to 0 linked packages and leaves go.mod entirely.
  • go test ./pkg/render/istio/... (the only helm consumer) passes.
  • go test ./pkg/... behaves identically to pristine release-v1.41: every package passes on both trees except pkg/controller/installation, which hits go test's default 600s timeout on both alike. CI runs ginkgo rather than go test, so that timeout is an artifact of the local invocation, not a regression. Diffed against a clean checkout of the branch.

Companion PRs

If the Go toolchain lift isn't wanted on this branch, the alternative is to keep bumping containerd here as advisories land — it's unreachable code, so exposure is limited either way. That's a reasonable call to make for v1.41 specifically, and it doesn't affect the other two PRs.

Release Note

None

…rable containerd (#5100)

containerd is not used by the operator. It arrives through one chain:

  pkg/render/istio -> helm.sh/helm/v3/pkg/action
                   -> helm.sh/helm/v3/pkg/registry   (helm's OCI client)
                   -> github.com/containerd/containerd/remotes

pkg/render/istio only uses helm as a local template renderer, so it never
contacts a registry, but pkg/action imports pkg/registry unconditionally
and containerd is linked in regardless. helm v3.21.3 replaced containerd's
remotes with oras-go/v2, so moving to it removes containerd outright.

(cherry picked from commit 3fce8ac)

Conflicts: go.mod, go.sum

This branch is the furthest behind of the three, so the pick carries the
most with it. Two things beyond the version bump:

1. A Go toolchain lift. helm v3.21.3 declares `go 1.26.0` and this branch
   builds with Go 1.25.7, so `go mod tidy` refuses:

     helm.sh/helm/v3@v3.21.3 requires go >= 1.26.0
     (running go 1.25.7; GOTOOLCHAIN=local)

   GO_BUILD_VER stays at 1.25.7 — the image does not change. Instead
   CONTAINERIZED gains `-e GOTOOLCHAIN=go1.26.4+auto`, letting the
   container fetch the newer toolchain, and go.mod's directive moves to
   `go 1.26.0`. This is the same arrangement release-v1.40 already uses.

2. A two-minor k8s jump. helm v3.21.3 requires client-go v0.36.2, and
   controller-runtime must move with it:

   | | before | after |
   |---|---|---|
   | helm | v3.19.5 | v3.21.3 |
   | controller-runtime | v0.22.5 | v0.24.1 |
   | k8s.io/{api,client-go,apimachinery,apiserver,apiextensions-apiserver,kube-aggregator} | v0.34.3 | v0.36.2 |
   | oras-go/v2 | v2.6.0 | v2.6.2 |
   | containerd | v1.7.29 + 3 more | gone |

   oras-go goes to v2.6.2 rather than the v2.6.1 that tidy selects, to
   match the CVE-2026-50151 / CVE-2026-50163 pin on the other branches.

These cannot be split into separate buildable commits: k8s.io/api v0.36
removed scheduling/v1alpha1, which helm v3.19.5's k8s.io/kubectl still
imports, and controller-runtime v0.22.5 does not support client-go v0.36.

No code changes were needed despite the two-minor controller-runtime jump.

Verified:
- go build ./... passes under Go 1.26.4; containerd drops to 0 linked
  packages and leaves go.mod entirely.
- go test ./pkg/render/istio/... (the only helm consumer) passes.
- go test ./pkg/... behaves identically to pristine release-v1.41: every
  package passes on both except pkg/controller/installation, which hits
  go test's default 600s timeout on both trees alike. CI runs ginkgo,
  not go test, so that timeout is an artifact of the local invocation.
@dimitri-nicolo
dimitri-nicolo requested a review from a team as a code owner August 13, 2026 19:47
Copilot AI lite review requested due to automatic review settings August 13, 2026 19:47
@marvin-tigera marvin-tigera added this to the v1.41.2 milestone Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the operator’s Go module graph to remove the vulnerable github.com/containerd/containerd dependency by upgrading Helm to v3.21.3 (and aligning required Kubernetes/controller-runtime versions), and adjusts the containerized build to use an auto-fetched Go 1.26 toolchain to satisfy Helm’s go 1.26 requirement.

Changes:

  • Add GOTOOLCHAIN=go1.26.4+auto to the containerized build environment in the Makefile.
  • Lift go.mod’s go directive to 1.26.0 and bump Helm to v3.21.3.
  • Align transitive dependency floors (notably k8s.io/* to v0.36.2 and controller-runtime to v0.24.1) and update go.sum accordingly.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
Makefile Sets GOTOOLCHAIN for containerized builds so the build image can fetch Go 1.26 automatically.
go.mod Raises the Go directive to 1.26 and bumps Helm + required k8s/controller-runtime versions to match.
go.sum Refreshes checksums for the new dependency graph and removes github.com/containerd/containerd sums.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dimitri-nicolo

Copy link
Copy Markdown
Contributor Author

Closing in favour of #5176.

This PR needed Go 1.26 on a branch that builds with Go 1.25.7, and we do not want to move release-v1.41 to Go 1.26. The CI failure made the cost concrete: golangci-lint in the branch's go-build image is built with Go 1.25 and refuses to lint a module targeting 1.26 (the Go language version (go1.25) used to build golangci-lint is lower than the targeted Go version (1.26.0)). That is fixable — release-v1.40 works around it with a separate CALICO_BUILD_LINT image — but it only papers over the fact that the operator binary would then be compiled by Go 1.26.4 via GOTOOLCHAIN.

There is no smaller helm that achieves the containerd removal: v3.21.3 is the only containerd-free release and every helm from v3.21.1 on declares go 1.26.0.

#5176 instead takes everything that is reachable under Go 1.25 — oras-go v2.6.0 → v2.6.2 (10 advisories → 0), helm v3.19.5 → v3.20.2 (chart extraction path traversal), containerd v1.7.29 → v1.7.34, and the k8s/controller-runtime floor those require. containerd stays, with three CRI-checkpoint advisories that only the helm v3.21.3 route can clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants