REPLACE-WITH-JIRA-KEY: Bump Kubernetes dependencies to v1.36.2#735
REPLACE-WITH-JIRA-KEY: Bump Kubernetes dependencies to v1.36.2#735dfarrell07 wants to merge 15 commits into
Conversation
go get k8s.io/api@v0.36.2 go get k8s.io/apiextensions-apiserver@v0.36.2 go get k8s.io/apimachinery@v0.36.2 go get k8s.io/apiserver@v0.36.2 go get k8s.io/client-go@v0.36.2 go get k8s.io/component-base@v0.36.2 go get sigs.k8s.io/controller-runtime@v0.24.1 go get github.com/openshift/api go get github.com/openshift/library-go go get k8s.io/klog go get k8s.io/klog/v2 go get k8s.io/kube-openapi go get k8s.io/kubernetes go get k8s.io/utils go get sigs.k8s.io/apiserver-network-proxy/konnectivity-client go get sigs.k8s.io/json go get sigs.k8s.io/randfill go get sigs.k8s.io/structured-merge-diff/v6 go get sigs.k8s.io/yaml go mod tidy Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
./Dockerfile ./Dockerfile.daemon Makefile Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
IntOrString no longer satisfies the %q verb directly in Go 1.26. Use .String() to convert before formatting. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
The old golangci-lint v1.54.2 pulls golang.org/x/tools v0.12.0 which is incompatible with Go 1.26 (invalid array length in tokeninternal). Update to golangci-lint v2.2.1 and fix the install path for the v2 module layout. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Applied: bump golangci-lint version Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Both should reference v2.12.2 for consistency. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Common unchecked return values from fmt.Fprintf, .Close() in tests are excluded via exclude-functions rather than per-line nolint directives. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
ioutil.ReadDir -> os.ReadDir, ioutil.ReadFile -> os.ReadFile. Both deprecated since Go 1.16. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Consolidate double imports of the same package under a single alias in ebpfsyncer, k8sreporter, and namespaces. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Error strings should not be capitalized per Go style guidelines. Updated test assertions that match error text. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Use corev1.NamespaceAll after removing the duplicate v1 import. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Exclude QF1008 (embedded field selectors), QF1001 (De Morgan), QF1003 (tagged switch), ST1001 (dot imports in tests), and scheme.Builder SA1019 deprecation. Add errcheck exclusions for tls.Conn and PipeWriter Close. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Consolidate bare and aliased imports of the same package. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
The interfaces slice was built but never used (SA4010). The fmt.Sprintf call with no format args is replaced with a string literal (S1039). Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
Update the local dev kind-cluster.sh from the ancient v1.27.3 to v1.36.1 to match the k8s rebase target. Restore the .x suffix on ENVTEST_K8S_VERSION to pick up future patch releases. Signed-off-by: Daniel Farrell <dfarrell@redhat.com> Assisted-by: Claude Code <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dfarrell07 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
WalkthroughThe PR updates the project to Go 1.26, newer Kubernetes and linting tooling, refreshed dependencies, and modernized selected eBPF, filesystem, Kubernetes API, and error-handling code. ChangesProject modernization
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.golangci.yml (1)
18-30: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftDo not globally ignore
Closeerrors.As per path instructions for Go security, you must "Never ignore error returns". Configuring
errcheckto globally ignoreClose()operations, particularly on writable streams like*os.File,*io.PipeWriter, and network connections, violates this principle. Failing to check these errors can lead to silent data loss or resource leaks, as failures to flush data to disk or close a connection gracefully will be masked.🛡️ Proposed fix to enforce checking Close errors
errcheck: exclude-functions: - fmt.Fprintf - fmt.Fprintln - fmt.Fprint - - (net.Conn).Close - - (net.Listener).Close - - (io.Closer).Close - - (*os.File).Close - - (io.ReadCloser).Close - - (*crypto/tls.Conn).Close - - (*io.PipeWriter).Close🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.golangci.yml around lines 18 - 30, Remove all Close-related entries from errcheck.exclude-functions in the errcheck configuration, including connection, listener, closer, file, TLS, and pipe-writer Close symbols, so callers must explicitly handle their returned errors; leave the fmt print exclusions unchanged.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Dockerfile`:
- Line 2: Pin the golang builder image by its SHA256 digest instead of the
floating 1.26 tag in the Dockerfile FROM declaration, and apply the same digest
pin to the golang:1.26 FROM declaration in Dockerfile.daemon (lines 1-1). Keep
the golang:1.26 image version unchanged.
In `@go.mod`:
- Around line 15-32: Update the go.mod dependency pins to versions that
remediate the OSV advisories for k8s.io/kubernetes v1.36.2 and the Go 1.26.0
standard library. Keep the Kubernetes-related module versions mutually
compatible and ensure the resulting module metadata reflects the patched Go
toolchain version before merging.
---
Outside diff comments:
In @.golangci.yml:
- Around line 18-30: Remove all Close-related entries from
errcheck.exclude-functions in the errcheck configuration, including connection,
listener, closer, file, TLS, and pipe-writer Close symbols, so callers must
explicitly handle their returned errors; leave the fmt print exclusions
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| @@ -1,5 +1,5 @@ | |||
| # Build the manager binary | |||
| FROM golang:1.25 as builder | |||
| FROM golang:1.26 as builder | |||
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Pin non-Red Hat base images by digest.
As per path instructions for container security, non-Red Hat images (like golang) must be pinned by their SHA256 digest rather than using a floating tag (e.g., 1.26). This ensures build reproducibility and mitigates upstream supply chain attacks.
Dockerfile#L2-L2: Pingolang:1.26by its digest.Dockerfile.daemon#L1-L1: Pingolang:1.26by its digest.
📍 Affects 2 files
Dockerfile#L2-L2(this comment)Dockerfile.daemon#L1-L1
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Dockerfile` at line 2, Pin the golang builder image by its SHA256 digest
instead of the floating 1.26 tag in the Dockerfile FROM declaration, and apply
the same digest pin to the golang:1.26 FROM declaration in Dockerfile.daemon
(lines 1-1). Keep the golang:1.26 image version unchanged.
Source: Path instructions
| github.com/openshift/api v0.0.0-20260715165912-72066cc9718b | ||
| github.com/openshift/controller-runtime-common v0.0.0-20260428152732-64ee174f5e2e | ||
| github.com/openshift/library-go v0.0.0-20260615113748-bc9d4056464b | ||
| github.com/openshift/library-go v0.0.0-20260716164659-7926d144f96a | ||
| github.com/pkg/errors v0.9.1 | ||
| github.com/prometheus/client_golang v1.23.2 | ||
| github.com/prometheus/common v0.66.1 | ||
| github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa | ||
| golang.org/x/sys v0.42.0 | ||
| github.com/prometheus/common v0.67.5 | ||
| github.com/vishvananda/netlink v1.3.1 | ||
| golang.org/x/sys v0.45.0 | ||
| gopkg.in/mcuadros/go-syslog.v2 v2.3.0 | ||
| k8s.io/api v0.35.2 | ||
| k8s.io/apiextensions-apiserver v0.35.1 | ||
| k8s.io/apimachinery v0.35.2 | ||
| k8s.io/client-go v0.35.2 | ||
| k8s.io/component-base v0.35.1 | ||
| k8s.io/api v0.36.2 | ||
| k8s.io/apiextensions-apiserver v0.36.2 | ||
| k8s.io/apimachinery v0.36.2 | ||
| k8s.io/client-go v0.36.2 | ||
| k8s.io/component-base v0.36.2 | ||
| k8s.io/klog v1.0.0 | ||
| k8s.io/kubernetes v1.32.3 | ||
| k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 | ||
| sigs.k8s.io/controller-runtime v0.23.3 | ||
| k8s.io/kubernetes v1.36.2 | ||
| k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 | ||
| sigs.k8s.io/controller-runtime v0.24.1 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check for known vulnerabilities in the updated dependencies.
# Install and run osv-scanner on go.mod
go install github.com/google/osv-scanner/cmd/osv-scanner@latest
$(go env GOPATH)/bin/osv-scanner -L go.modRepository: openshift/ingress-node-firewall
Length of output: 8358
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '1,40p' go.modRepository: openshift/ingress-node-firewall
Length of output: 1552
Bump the vulnerable pins before merging. k8s.io/kubernetes v1.36.2 is flagged by OSV (GO-2025-3521, GO-2025-3547), and go 1.26.0 is also reported with open stdlib advisories.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@go.mod` around lines 15 - 32, Update the go.mod dependency pins to versions
that remediate the OSV advisories for k8s.io/kubernetes v1.36.2 and the Go
1.26.0 standard library. Keep the Kubernetes-related module versions mutually
compatible and ensure the resulting module metadata reflects the patched Go
toolchain version before merging.
Source: Path instructions
Summary
Rebase all
k8s.io/*dependencies from v0.35.2 to v0.36.2 (Kubernetes 1.36.2), including:What changed
.golangci.ymlconfigio/ioutil→osequivalents, duplicate imports removedCommits
Verification
Locally verified:
go build ./...— PASSgo vet ./...— PASSAssisted-by: Claude CodetrailersNotes
.golangci.ymlexclusions (embedded field selectors, tagged switch suggestions, dot imports in tests).hack/kind-cluster.shstill uses kubeadm v1beta3extraArgsmap format — deprecated since k8s 1.31 but still functional. Migration to v1beta4 list format can be done separately.All commits carry
Assisted-by: Claude Codetrailers.Summary by CodeRabbit
Compatibility
Developer Experience
Bug Fixes