diff options
| author | Kubernetes Submit Queue <k8s-merge-robot@users.noreply.github.com> | 2017-11-09 06:31:45 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-09 06:31:45 -0800 |
| commit | e1b72cb444ab2a0eb8f936bc1a71ca20169c7522 (patch) | |
| tree | 07a0ecd4a1f75ec1d73069d5dc00d3ec0d419409 /contributors/devel/api_changes.md | |
| parent | 0d5be6151b90f8c797043683479e37e0c3b6e999 (diff) | |
| parent | 2918c4d153df0e666a97e1e1dfaa8085fec8222a (diff) | |
Merge pull request #1348 from sttts/sttts-group-go-name
Automatic merge from submit-queue.
contributors/devel: document '// +groupGoName' code-generation tag
Documentation counterpart PR for https://github.com/kubernetes/kubernetes/pull/54950.
Diffstat (limited to 'contributors/devel/api_changes.md')
| -rw-r--r-- | contributors/devel/api_changes.md | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/contributors/devel/api_changes.md b/contributors/devel/api_changes.md index d592feab..d4fcc322 100644 --- a/contributors/devel/api_changes.md +++ b/contributors/devel/api_changes.md @@ -524,7 +524,7 @@ run it several times to ensure there are no incompletely calculated fields. `client-gen` is a tool to generate clientsets for top-level API objects. -`client-gen` requires the `// +genclient=true` annotation on each +`client-gen` requires the `// +genclient` annotation on each exported type in both the internal `pkg/apis/<group>/types.go` as well as each specifically versioned `staging/src/k8s.io/api/<group>/<version>/types.go`. @@ -542,13 +542,17 @@ Once you added the annotations, generate the client with hack/update-codegen.sh ``` +Note that you can use the optional `// +groupGoName=` to specify a CamelCase +custom Golang identifier to de-conflict e.g. `policy.authorization.k8s.io` and +`policy.k8s.io`. These two would both map to `Policy()` in clientsets. + client-gen is flexible. See [this document](generating-clientset.md) if you need client-gen for non-kubernetes API. ### Generate Listers `lister-gen` is a tool to generate listers for a client. It reuses the -`//+genclient=true` and the `// +groupName=` annotations, so you do not need to +`//+genclient` and the `// +groupName=` annotations, so you do not need to specify extra annotations. Your previous run of `hack/update-codegen.sh` has invoked `lister-gen`. @@ -556,7 +560,7 @@ Your previous run of `hack/update-codegen.sh` has invoked `lister-gen`. ### Generate Informers `informer-gen` generates the very useful Informers which watch API -resources for changes. It reuses the `//+genclient=true` and the +resources for changes. It reuses the `//+genclient` and the `//+groupName=` annotations, so you do not need to specify extra annotations. Your previous run of `hack/update-codegen.sh` has invoked `informer-gen`. |
