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"