-
Notifications
You must be signed in to change notification settings - Fork 1.3k
build(deps): fix tests following k8s v0.35.0 update
#14827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(deps): fix tests following k8s v0.35.0 update
#14827
Conversation
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]>
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]>
There was a problem hiding this 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.shfor v0.35.0 compatibility - Updated test expectations to account for EndpointPort ordering changes due to new
AppProtocolfield 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 |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
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.
| // IsWatchListSemanticsSupported informs the reflector that this client | |
| // IsWatchListSemanticsUnSupported informs the reflector that this client |
| // 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 { |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
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'.
Signed-off-by: Andrew Seigner <[email protected]>
alpeb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @siggy !
f8a99ea
into
linkerd:dependabot/go_modules/kube-479ece7fe5
#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]>
This PR stacks on the k8s
v0.35.0dep 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
EndpointPortordering in testsThe
EndpointPortstruct inv0.35.0added a newAppProtocolfield, causingNewPortMapKeyhashing function to change, causing test ordering output to change.commit 2: run
update-codegen.shforv0.35.0commit 3: fix healthcheck test
Pass
kubernetes.InterfaceintoNewClusterScopedAPIso the informer will see the fake clientset implementsIsWatchListSemanticsUnSupported.commit 4: fix go lint