From 20b997d439fa139f5e98aada5d68cf05c2504243 Mon Sep 17 00:00:00 2001 From: Swati Sehgal Date: Wed, 18 Oct 2023 18:37:48 +0100 Subject: [PATCH] hack: Update to using kube_codegen.sh instead of generate-groups.sh We are getting the following warnings if we continue using generate-groups.sh so updating to kube_codegen.sh instead as per the recommendation: ``` WARNING: generate-groups.sh is deprecated. WARNING: Please use k8s.io/code-generator/kube_codegen.sh instead. ``` Signed-off-by: Swati Sehgal --- hack/update-codegen.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 4ba1d69..e5a5cd1 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -21,14 +21,18 @@ set -o pipefail SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} +source "${CODEGEN_PKG}/kube_codegen.sh" # generate the code with: # --output-base because this script should also be able to run inside the vendor dir of # kubernetes-sigs/noderesourcetopology-api. The output-base is needed for # the generators to output into the vendor dir instead of the $GOPATH directly. # For normal projects this can be dropped. # -bash "${CODEGEN_PKG}"/generate-groups.sh "deepcopy,client,informer,lister" \ - sigs.k8s.io/noderesourcetopology-api/pkg/generated sigs.k8s.io/noderesourcetopology-api/pkg/apis \ - topology:v1alpha1 \ - --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ - --go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt + +kube::codegen::gen_client \ + --with-watch \ + --with-applyconfig \ + --input-pkg-root sigs.k8s.io/noderesourcetopology-api/pkg/apis \ + --output-pkg-root sigs.k8s.io/noderesourcetopology-api/pkg/generated \ + --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ + --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"