diff options
| author | Kubernetes Submit Queue <k8s-merge-robot@users.noreply.github.com> | 2016-08-27 00:45:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-27 00:45:52 -0700 |
| commit | 7e7a771d8114262d2e36b8cbffcb00053def4112 (patch) | |
| tree | 62b3c02fbdd08669c0a7ee9d63b4a05ef318c74d | |
| parent | 33dbe1a2592659bb650feda4cab4eda2826852df (diff) | |
| parent | eac888c221453fadcb9e84b08d4d153e8edd0894 (diff) | |
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
| -rw-r--r-- | generating-clientset.md | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/generating-clientset.md b/generating-clientset.md index 4fd3044c..35d04d74 100644 --- a/generating-clientset.md +++ b/generating-clientset.md @@ -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 |
