Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions hack/update-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ import (
EOF

go mod tidy
go mod vendor
# Download dependencies to module cache instead of vendor directory
go mod download

SDK_HACK_DIR="$(cd "$(dirname "$(readlink "$0" || echo "$0")")"; pwd)"
source ${SDK_HACK_DIR}/../vendor/k8s.io/code-generator/kube_codegen.sh
# Get code-generator path from module cache
CODEGEN_PKG=$(go list -m -f '{{.Dir}}' k8s.io/code-generator)
source ${CODEGEN_PKG}/kube_codegen.sh
kube::codegen::gen_client \
--boilerplate ${SDK_HACK_DIR}/boilerplate.go.kb.txt \
--with-watch \
--output-dir ${SDK_HACK_DIR}/../pkg/apis/client \
--output-pkg github.com/NVIDIA/KAI-scheduler/pkg/apis/client \
${SDK_HACK_DIR}/../pkg/apis

rm -f generate-dep.go && rm -r vendor && go mod tidy
# Clean up temporary files
rm -f generate-dep.go && go mod tidy

changed_files=$(git diff --name-only | grep pkg/apis/client | grep v1alpha2)
${SDK_HACK_DIR}/replace_headers.sh \
Expand Down