mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 11:42:14 +00:00
Merge pull request #55403 from sttts/sttts-client-gen-ext-group-list
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. code-generator: move kube group list out of client-gen We had a hard-coded group list in the client-gen code for the internal Kubernetes api groups. For the external groups, we collected the actual GVs in update-codegen.sh. This PR does the latter for internal groups as well.
This commit is contained in:
@@ -40,6 +40,7 @@ informergen=$(kube::util::find-binary "informer-gen")
|
||||
|
||||
GROUP_VERSIONS=(${KUBE_AVAILABLE_GROUP_VERSIONS})
|
||||
GV_DIRS=()
|
||||
INTERNAL_DIRS=()
|
||||
for gv in "${GROUP_VERSIONS[@]}"; do
|
||||
# add items, but strip off any leading apis/ you find to match command expectations
|
||||
api_dir=$(kube::util::group-version-to-pkg-path "${gv}")
|
||||
@@ -47,19 +48,30 @@ for gv in "${GROUP_VERSIONS[@]}"; do
|
||||
nopkg_dir=${nopkg_dir#vendor/k8s.io/api/}
|
||||
pkg_dir=${nopkg_dir#apis/}
|
||||
|
||||
|
||||
# skip groups that aren't being served, clients for these don't matter
|
||||
if [[ " ${KUBE_NONSERVER_GROUP_VERSIONS} " == *" ${gv} "* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
GV_DIRS+=("${pkg_dir}")
|
||||
|
||||
# collect internal groups
|
||||
int_group="${pkg_dir%/*}/"
|
||||
if [[ "${pkg_dir}" = core/* ]]; then
|
||||
int_group="api/"
|
||||
fi
|
||||
if ! [[ " ${INTERNAL_DIRS[@]:-} " =~ " ${int_group} " ]]; then
|
||||
INTERNAL_DIRS+=("${int_group}")
|
||||
fi
|
||||
done
|
||||
# delimit by commas for the command
|
||||
GV_DIRS_CSV=$(IFS=',';echo "${GV_DIRS[*]// /,}";IFS=$)
|
||||
INTERNAL_DIRS_CSV=$(IFS=',';echo "${INTERNAL_DIRS[*]// /,}";IFS=$)
|
||||
|
||||
# This can be called with one flag, --verify-only, so it works for both the
|
||||
# update- and verify- scripts.
|
||||
${clientgen} "$@"
|
||||
${clientgen} --input-base="k8s.io/kubernetes/pkg/apis" --input="${INTERNAL_DIRS_CSV}" "$@"
|
||||
${clientgen} --output-base "${KUBE_ROOT}/vendor" --clientset-path="k8s.io/client-go" --clientset-name="kubernetes" --input-base="k8s.io/kubernetes/vendor/k8s.io/api" --input="${GV_DIRS_CSV}" "$@"
|
||||
|
||||
listergen_internal_apis=(
|
||||
|
Reference in New Issue
Block a user