Merge pull request #31470 from caesarxuchao/regenerate-release-1-4
Automatic merge from submit-queue Fix missing expansion files in clientset release 1.4 <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md 2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md 3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes --> **What this PR does / why we need it**: Fix missing expansion files in clientset release 1.4; Update the client-gen tool to automatically update generated_expansion.go; Update the readme to document the best practice of using client-gen. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # https://github.com/kubernetes/kubernetes/issues/29698#issuecomment-241315798 **Special notes for your reviewer**: **Release note**: <!-- Steps to write your release note: 1. Use the release-note-* labels to set the release note state (if you have access) 2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. --> ```release-note ``` cc @lavalamp @krousey @mbohlool
This commit is contained in:
@@ -62,12 +62,16 @@ will generate a clientset named "my_release" which includes clients for api/v1
|
||||
objects and extensions/v1beta1 objects. You can run `$ client-gen --help` to see
|
||||
other command line arguments.
|
||||
|
||||
- Adding expansion methods: client-gen only generates the common methods, such
|
||||
as `Create()` and `Delete()`. You can manually add additional methods through
|
||||
the expansion interface. For example, this
|
||||
[file](../../pkg/client/clientset_generated/release_1_2/typed/core/v1/pod_expansion.go)
|
||||
adds additional methods to Pod's client. As a convention, we put the expansion
|
||||
interface and its methods in file ${TYPE}_expansion.go.
|
||||
- ***Adding expansion methods***: client-gen only generates the common methods,
|
||||
such as `Create()` and `Delete()`. You can manually add additional methods
|
||||
through the expansion interface. For example, this
|
||||
[file](../../pkg/client/clientset_generated/release_1_4/typed/core/v1/pod_expansion.go)
|
||||
adds additional methods to Pod's client. As a convention, we put the expansion
|
||||
interface and its methods in file ${TYPE}_expansion.go. In most cases, you
|
||||
don't want to remove existing expansion files. So to make life easier,
|
||||
instead of creating a new clientset from scratch, ***you can copy and rename an
|
||||
existing clientset (so that all the expansion files are copied)***, and then run
|
||||
client-gen.
|
||||
|
||||
- Generating fake clients for testing purposes: client-gen will generate a fake
|
||||
clientset if the command line argument `--fake-clientset` is set. The fake
|
||||
|
Reference in New Issue
Block a user