-
Notifications
You must be signed in to change notification settings - Fork 14
✨ Add cluster-aware versions of gentype and listers, update testing #43
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
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all |
/test all |
/test all |
1 similar comment
/test all |
/test all |
/test all |
/test all |
/test all |
Summary
kcp-dev/code-generator#107 reworks the kcp code-generator to use the generic-style code that was introduced recently (around kube 1.32) in upstream. To fully take advantage of this approach, it's necessary to also provide cluster-aware variants of ResourceIndexers, fake Clients etc.
This PR adds those by soft-forking client-go's gentype and listers package, and then adding cluster-aware types to it.
Additionally, this PR also includes all changes to k8s.io/client-go/testing that happened between Kubernetes 1.26 and 1.32, specifically this list of k/k commits (commits in italics happened in that range, but did not modify the testing package and so were skipped):
b0ce65df9
: Generify fake clientsets93f82d25a
: Merge pull request #127689 from mmorel-35/testifylint/[email protected]/client-go71ced25f4
: fix: enable error-nil and nil-compare rules from testifylint in modulek8s.io/client-go
8286a6903
: fix: enable expected-actual rule from testifylint in modulek8s.io/client-go
5784e5844
: Use Fatalf for non-recoverable errors in test5f1c7ae63
: Stamp fake client apply reuqests with name from action1095af88e
: Remove test dependency on swwagger.json to fix client-go repo75d6f0243
: Add field tracker support to client fake fixtures599f03c72
: Support options for all client fake actions5300466a5
: Use canonical json-patch v4 import1.26 was chosen as the base because last time we touched our fork of the testing package was in #25.
NB: There is a
hack/populate-copies.sh
in this repo and it gives off the impression that some files in third_party/ are not meant to be modified, but copied wholesale 1:1 from k/k. However since that script was added, maaaaany changes have been done to those copied files and I think today, that script is pointless. But I'm not sure and so I kept it for ... sentimental reasons. That is also why I did not put the files from gentype and listers into the script.All of these changes have been tested in conjunction with kcp-dev/code-generator#107 in kcp main branch and all unit/e2e tests pass.