Skip to content

Commit 511003c

Browse files
committed
Add --exclude-packages
Signed-off-by: Nelo-T. Wallus <[email protected]>
1 parent 34af3cd commit 511003c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

cluster_codegen.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ function cluster::codegen::internal::grep() {
126126
# --plural-exceptions <string = "">
127127
# An optional list of comma separated plural exception definitions in Type:PluralizedType form.
128128
#
129+
# --exclude-packages <string = "">
130+
# An optional list of comma separate group verions to exclude from
131+
# client generation.
132+
#
129133
function cluster::codegen::gen_client() {
130134
local in_dir=""
131135
local one_input_api=""
@@ -144,6 +148,7 @@ function cluster::codegen::gen_client() {
144148
local single_cluster_listers_pkg=""
145149
local watchable="false"
146150
local plural_exceptions=""
151+
local exclude_pkgs=""
147152
local v="${KUBE_VERBOSE:-0}"
148153

149154
while [ "$#" -gt 0 ]; do
@@ -212,6 +217,10 @@ function cluster::codegen::gen_client() {
212217
plural_exceptions="$2"
213218
shift 2
214219
;;
220+
"--exclude-packages")
221+
exclude_pkgs="$2"
222+
shift 2
223+
;;
215224
*)
216225
if [[ "$1" =~ ^-- ]]; then
217226
echo "unknown argument: $1" >&2
@@ -265,7 +274,13 @@ function cluster::codegen::gen_client() {
265274

266275
dir2="$(dirname "${dir}")"
267276
leaf2="$(basename "${dir2}")"
268-
group_versions+=("${leaf2}/${leaf}")
277+
gv="${leaf2}/${leaf}"
278+
279+
if [[ " ${exclude_pkgs} " == *" ${gv} "* ]]; then
280+
continue
281+
fi
282+
283+
group_versions+=("${gv}")
269284
fi
270285
done < <(
271286
( cluster::codegen::internal::grep -l --null \

0 commit comments

Comments
 (0)