Skip to content

Commit 18bcf2e

Browse files
MikeSpreitzerk8s-publishing-bot
authored andcommitted
Add note about directory structure
Signed-off-by: Mike Spreitzer <[email protected]> Kubernetes-commit: b88fefad1f836c4c144c7a0550f3b0b324f45a1b
1 parent 5ad9f43 commit 18bcf2e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ These code-generators can be used
1414
- The example [sample controller](https://github.com/kubernetes/sample-controller) shows a code example of a controller that uses the clients, listers and informers generated by this library.
1515
- The article [Kubernetes Deep Dive: Code Generation for CustomResources](https://cloud.redhat.com/blog/kubernetes-deep-dive-code-generation-customresources/) gives a step by step instruction on how to use this library.
1616

17+
## Usage
18+
19+
The examples above are dated. The current recommended script to use is [kube_codegen.sh](kube_codegen.sh).
20+
1721
## Compatibility
1822

1923
HEAD of this repo will match HEAD of k8s.io/apiserver, k8s.io/apimachinery, and k8s.io/client-go.

kube_codegen.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
# This presents several functions for packages which want to use kubernetes
1818
# code-generation tools.
1919

20+
# These functions insist that your input IDL (commented go) files be located in
21+
# go packages following the pattern $input_pkg_root/$something_sans_slash/$api_version .
22+
# Those $something_sans_slash will be propagated into the output directory structure.
23+
2024
set -o errexit
2125
set -o nounset
2226
set -o pipefail
@@ -42,6 +46,7 @@ function kube::codegen::internal::git_grep() {
4246
# --input-pkg-root <string>
4347
# The root package under which to search for files which request code to be
4448
# generated. This must be Go package syntax, e.g. "k8s.io/foo/bar".
49+
# See note at the top about package structure below that.
4550
#
4651
# --output-base <string>
4752
# The root directory under which to emit code. The concatenation of
@@ -229,6 +234,7 @@ function kube::codegen::gen_helpers() {
229234
# --input-pkg-root <string>
230235
# The root package under which to search for files which request openapi to
231236
# be generated. This must be Go package syntax, e.g. "k8s.io/foo/bar".
237+
# See note at the top about package structure below that.
232238
#
233239
# --output-pkg-root <string>
234240
# The root package under which generated directories and files
@@ -399,6 +405,7 @@ function kube::codegen::gen_openapi() {
399405
# The root package under which to search for *.go files which request
400406
# clients to be generated. This must be Go package syntax, e.g.
401407
# "k8s.io/foo/bar".
408+
# See note at the top about package structure below that.
402409
#
403410
# --one-input-api <string>
404411
# A specific API (a directory) under the --input-pkg-root for which to

0 commit comments

Comments
 (0)