mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #123387 from soltysh/kube_codegen
kube_codegen: add plural-exceptions and use grep for finding API types
This commit is contained in:
commit
df1803f601
@ -460,6 +460,9 @@ function kube::codegen::gen_openapi() {
|
||||
# --informers-name <string = "informers">
|
||||
# An optional override for the leaf name of the generated "informers" directory.
|
||||
#
|
||||
# --plural-exceptions <string = "">
|
||||
# An optional list of comma separated plural exception definitions in Type:PluralizedType form.
|
||||
#
|
||||
function kube::codegen::gen_client() {
|
||||
local in_pkg_root=""
|
||||
local one_input_api=""
|
||||
@ -473,6 +476,7 @@ function kube::codegen::gen_client() {
|
||||
local listers_subdir="listers"
|
||||
local informers_subdir="informers"
|
||||
local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt"
|
||||
local plural_exceptions=""
|
||||
local v="${KUBE_VERBOSE:-0}"
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
@ -525,6 +529,10 @@ function kube::codegen::gen_client() {
|
||||
informers_subdir="$2"
|
||||
shift 2
|
||||
;;
|
||||
"--plural-exceptions")
|
||||
plural_exceptions="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "unknown argument: $1" >&2
|
||||
return 1
|
||||
@ -640,6 +648,7 @@ function kube::codegen::gen_client() {
|
||||
--output-base "${out_base}" \
|
||||
--output-package "${out_pkg_root}/${clientset_subdir}" \
|
||||
--apply-configuration-package "${applyconfig_pkg}" \
|
||||
--plural-exceptions "${plural_exceptions}" \
|
||||
"${inputs[@]}"
|
||||
|
||||
if [ "${watchable}" == "true" ]; then
|
||||
@ -661,6 +670,7 @@ function kube::codegen::gen_client() {
|
||||
--go-header-file "${boilerplate}" \
|
||||
--output-base "${out_base}" \
|
||||
--output-package "${out_pkg_root}/${listers_subdir}" \
|
||||
--plural-exceptions "${plural_exceptions}" \
|
||||
"${inputs[@]}"
|
||||
|
||||
echo "Generating informer code for ${#input_pkgs[@]} targets"
|
||||
@ -683,6 +693,7 @@ function kube::codegen::gen_client() {
|
||||
--output-package "${out_pkg_root}/${informers_subdir}" \
|
||||
--versioned-clientset-package "${out_pkg_root}/${clientset_subdir}/${clientset_versioned_name}" \
|
||||
--listers-package "${out_pkg_root}/${listers_subdir}" \
|
||||
--plural-exceptions "${plural_exceptions}" \
|
||||
"${inputs[@]}"
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user