Skip to content

Conversation

@siggy
Copy link
Member

@siggy siggy commented Dec 23, 2025

This PR stacks on the k8s v0.35.0 dep updates in #14817. Notable change is watch‑list/initial‑events are on by default, and fake.Clientset doesn’t emit an initial bookmark, so informers never sync.

This PR is broken into 4 separate commits for easier reviewing.

commit 1: fix EndpointPort ordering in tests

The EndpointPort struct in v0.35.0 added a new AppProtocol field, causing NewPortMapKey hashing function to change, causing test ordering output to change.

commit 2: run update-codegen.sh for v0.35.0

commit 3: fix healthcheck test

Pass kubernetes.Interface into NewClusterScopedAPI so the informer will see the fake clientset implements IsWatchListSemanticsUnSupported.

commit 4: fix go lint

The `EndpointPort` struct in `v0.35.0` added a new `AppProtocol` field,
causing `NewPortMapKey` hashing function to change, causing test
ordering output to change.

Signed-off-by: Andrew Seigner <[email protected]>
Pass `kubernetes.Interface` into `NewClusterScopedAPI` so the informer
will see the fake clientset implements
`IsWatchListSemanticsUnSupported`.

Signed-off-by: Andrew Seigner <[email protected]>
@siggy siggy self-assigned this Dec 23, 2025
Copilot AI review requested due to automatic review settings December 23, 2025 09:20
@siggy siggy requested a review from a team as a code owner December 23, 2025 09:20
Copy link

Copilot AI left a comment

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 adapts the codebase to work with Kubernetes client-go v0.35.0, where watch-list semantics with initial events are enabled by default. Since the fake Kubernetes clientset doesn't emit initial bookmarks, informers fail to sync in tests. The changes span three commits addressing test ordering, code generation updates, and a critical healthcheck fix.

Key Changes

  • Fixed healthcheck to pass the correct interface type to NewClusterScopedAPI, enabling the fake clientset to properly signal watch-list semantics support
  • Regenerated all Kubernetes client code (informers, clientsets) using update-codegen.sh for v0.35.0 compatibility
  • Updated test expectations to account for EndpointPort ordering changes due to new AppProtocol field in v0.35.0

Reviewed changes

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

Show a summary per file
File Description
pkg/healthcheck/healthcheck.go Changed to pass hc.kubeAPI.Interface instead of hc.kubeAPI to match updated function signature
controller/gen/client/informers/externalversions/**/*.go Wrapped ListWatch with ToListWatcherWithWatchListSemantics, replaced context.TODO() with context.Background(), added context-aware functions
controller/gen/client/clientset/versioned/typed/**/*_client.go Removed error return from setConfigDefaults function signature
controller/gen/client/informers/externalversions/factory.go Fixed documentation example to properly use context.WithCancel
controller/gen/client/clientset/versioned/fake/clientset_generated.go Added IsWatchListSemanticsUnSupported method and updated watch reactor to pass ListOptions
controller/api/destination/external-workload/endpoints_controller_test.go Reordered endpoint ports in test cases and added detailed logging for port comparison failures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return c.tracker
}

// IsWatchListSemanticsSupported informs the reflector that this client
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The documentation comment refers to "IsWatchListSemanticsSupported" but the actual method name on line 113 is "IsWatchListSemanticsUnSupported". The comment should be updated to match the method name.

Suggested change
// IsWatchListSemanticsSupported informs the reflector that this client
// IsWatchListSemanticsUnSupported informs the reflector that this client

Copilot uses AI. Check for mistakes.
// interface check performed by the reflector.
// Returning true signals that WatchList can NOT be used.
// No additional logic is implemented here.
func (c *Clientset) IsWatchListSemanticsUnSupported() bool {
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The method name "IsWatchListSemanticsUnSupported" uses non-standard Go naming with a capital 'S' in the middle of "UnSupported". According to Go naming conventions, this should be "IsWatchListSemanticsUnsupported" with a lowercase 's'.

Copilot uses AI. Check for mistakes.
Signed-off-by: Andrew Seigner <[email protected]>
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @siggy !

@siggy siggy merged commit f8a99ea into linkerd:dependabot/go_modules/kube-479ece7fe5 Dec 23, 2025
62 of 66 checks passed
@siggy siggy deleted the dependabot/go_modules/kube-479ece7fe5 branch December 23, 2025 17:16
alpeb pushed a commit that referenced this pull request Dec 23, 2025
#14817)

* build(deps): bump the kube group with 8 updates

Bumps the kube group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.34.3` | `0.35.0` |
| [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver) | `0.34.3` | `0.35.0` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) | `0.34.3` | `0.35.0` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.34.3` | `0.35.0` |
| [k8s.io/code-generator](https://github.com/kubernetes/code-generator) | `0.34.3` | `0.35.0` |
| [k8s.io/endpointslice](https://github.com/kubernetes/endpointslice) | `0.34.3` | `0.35.0` |
| [k8s.io/kube-aggregator](https://github.com/kubernetes/kube-aggregator) | `0.34.3` | `0.35.0` |
| [k8s.io/utils](https://github.com/kubernetes/utils) | `0.0.0-20250604170112-4c0f3b243397` | `0.0.0-20251002143259-bc988d571ff4` |


Updates `k8s.io/api` from 0.34.3 to 0.35.0
- [Commits](kubernetes/api@v0.34.3...v0.35.0)

Updates `k8s.io/apiextensions-apiserver` from 0.34.3 to 0.35.0
- [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases)
- [Commits](kubernetes/apiextensions-apiserver@v0.34.3...v0.35.0)

Updates `k8s.io/apimachinery` from 0.34.3 to 0.35.0
- [Commits](kubernetes/apimachinery@v0.34.3...v0.35.0)

Updates `k8s.io/client-go` from 0.34.3 to 0.35.0
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](kubernetes/client-go@v0.34.3...v0.35.0)

Updates `k8s.io/code-generator` from 0.34.3 to 0.35.0
- [Commits](kubernetes/code-generator@v0.34.3...v0.35.0)

Updates `k8s.io/endpointslice` from 0.34.3 to 0.35.0
- [Commits](kubernetes/endpointslice@v0.34.3...v0.35.0)

Updates `k8s.io/kube-aggregator` from 0.34.3 to 0.35.0
- [Commits](kubernetes/kube-aggregator@v0.34.3...v0.35.0)

Updates `k8s.io/utils` from 0.0.0-20250604170112-4c0f3b243397 to 0.0.0-20251002143259-bc988d571ff4
- [Commits](https://github.com/kubernetes/utils/commits)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kube
- dependency-name: k8s.io/apiextensions-apiserver
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kube
- dependency-name: k8s.io/apimachinery
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kube
- dependency-name: k8s.io/client-go
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kube
- dependency-name: k8s.io/code-generator
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kube
- dependency-name: k8s.io/endpointslice
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kube
- dependency-name: k8s.io/kube-aggregator
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kube
- dependency-name: k8s.io/utils
  dependency-version: 0.0.0-20251002143259-bc988d571ff4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: kube
...

Signed-off-by: dependabot[bot] <[email protected]>

* build(deps): fix tests following k8s `v0.35.0` update (#14827)

Fix `EndpointPort` ordering in tests:
The `EndpointPort` struct in `v0.35.0` added a new `AppProtocol` field,
causing `NewPortMapKey` hashing function to change, causing test
ordering output to change.

Run `update-codegen.sh` for `v0.35.0`

Fix healthcheck test:
Pass `kubernetes.Interface` into `NewClusterScopedAPI` so the informer
will see the fake clientset implements
`IsWatchListSemanticsUnSupported`.

Fix go lint

Signed-off-by: Andrew Seigner <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Andrew Seigner <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Seigner <[email protected]>
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.

2 participants