Skip to content

Upgrade Go packages to fix CVEs#1114

Open
balamut-google wants to merge 3 commits into
mainfrom
go_mod_upgrades
Open

Upgrade Go packages to fix CVEs#1114
balamut-google wants to merge 3 commits into
mainfrom
go_mod_upgrades

Conversation

@balamut-google

Copy link
Copy Markdown
Contributor

Proposed Changes

1. Root Module (github.com/google/kf/v2)

Upgraded github.com/docker/docker replacement version from v20.10.24+incompatible to v28.5.2+incompatible in root

go.mod
(resolves GO-2025-3829).
Refactored Term/Console Packages: The docker/docker/pkg/term dependency was removed in newer Docker CLI/engine versions. The importing code was refactored to use the modern alternative github.com/moby/term:

  • ssh.go
  • term.go
  • resize.go
  • term_writer.go

2. Submodule first_party/k8s-stateless-subresource

Upgraded google.golang.org/protobuf to v1.33.0 (resolves GO-2024-2611).
Upgraded google.golang.org/grpc to v1.56.3 (resolves GO-2023-2153).
Upgraded golang.org/x/oauth2 to v0.27.0 (resolves GO-2025-3488).
Upgraded github.com/golang/protobuf to v1.5.4 for compatibility.

3. Operator Module (github.com/google/kf/v2/operator)

Upgraded Go Toolchain from go1.20 to go1.25.0 in

operator/go.mod
.
Upgraded golang.org/x/net to v0.56.0 (resolves GO-2026-5026, GO-2026-4918, and GO-2024-2687).
Upgraded github.com/google/go-cmp to v0.6.0 to resolve comparisons clashing with new Go context internals.
Added operator/tools.go: Pinned code-generator packages (k8s.io/code-generator) and mock generation frameworks (github.com/golang/mock/mockgen) so they are correctly vendored.
Refactored Tests:
Modified

fake_owner_injector_test.go
to use cmpopts.IgnoreFields to skip comparing the Ctx field (containing context internals), resolving panics under Go 1.25+.

4. Build & Codegen Fixes

Fixed operator/hack/update-codegen.sh:
Resolved knative.dev/hack and k8s.io/code-generator script paths from the Go mod cache dynamically to support headless execution and prevent dependency package resolution errors during compilation.
Stubbed helper libraries operator/scripts/shared/library.sh and root hack/library.sh to allow codegen scripts to execute correctly.
Re-generated Client Fakes & Deepcopy API Objects under the operator's versioned clientset packages.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant