Skip to content

Commit

Permalink
hack: Update to using kube_codegen.sh instead of generate-groups.sh
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
swatisehgal committed Jan 25, 2024
1 parent f6cee70 commit 20b997d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 20b997d

Please sign in to comment.