kube_codegen: expose external-applyconfigurations flag for client generation

This commit is contained in:
Maciej Szulik 2024-02-21 13:37:27 +01:00
parent 6049a1bca4
commit 16794502ee
No known key found for this signature in database
GPG Key ID: F15E55D276FA84C4

View File

@ -451,6 +451,10 @@ function kube::codegen::gen_openapi() {
# --applyconfig-name <string = "applyconfiguration"> # --applyconfig-name <string = "applyconfiguration">
# An optional override for the leaf name of the generated "applyconfiguration" directory. # An optional override for the leaf name of the generated "applyconfiguration" directory.
# #
# --applyconfig-externals <string = "">
# An optional list of comma separated external apply configurations locations
# in <type-package>.<type-name>:<applyconfiguration-package> form.
#
# --with-watch # --with-watch
# Enables generation of listers and informers for APIs which support WATCH. # Enables generation of listers and informers for APIs which support WATCH.
# #
@ -472,6 +476,7 @@ function kube::codegen::gen_client() {
local clientset_versioned_name="versioned" local clientset_versioned_name="versioned"
local applyconfig="false" local applyconfig="false"
local applyconfig_subdir="applyconfiguration" local applyconfig_subdir="applyconfiguration"
local applyconfig_external=""
local watchable="false" local watchable="false"
local listers_subdir="listers" local listers_subdir="listers"
local informers_subdir="informers" local informers_subdir="informers"
@ -517,6 +522,10 @@ function kube::codegen::gen_client() {
applyconfig_subdir="$2" applyconfig_subdir="$2"
shift 2 shift 2
;; ;;
"--applyconfig-externals")
applyconfig_external="$2"
shift 2
;;
"--with-watch") "--with-watch")
watchable="true" watchable="true"
shift shift
@ -624,6 +633,7 @@ function kube::codegen::gen_client() {
--go-header-file "${boilerplate}" \ --go-header-file "${boilerplate}" \
--output-base "${out_base}" \ --output-base "${out_base}" \
--output-package "${out_pkg_root}/${applyconfig_subdir}" \ --output-package "${out_pkg_root}/${applyconfig_subdir}" \
--external-applyconfigurations "${applyconfig_external}" \
"${inputs[@]}" "${inputs[@]}"
fi fi