Skip to content

Commit 489b9f0

Browse files
authored
ci: optimize dependency management by using module cache instead of vendor directory (#645)
1 parent ad3ac0e commit 489b9f0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hack/update-client.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ import (
1313
EOF
1414

1515
go mod tidy
16-
go mod vendor
16+
go mod download
1717

1818
SDK_HACK_DIR="$(cd "$(dirname "$(readlink "$0" || echo "$0")")"; pwd)"
19-
source ${SDK_HACK_DIR}/../vendor/k8s.io/code-generator/kube_codegen.sh
19+
CODEGEN_PKG=$(go list -m -f '{{.Dir}}' k8s.io/code-generator)
20+
source ${CODEGEN_PKG}/kube_codegen.sh
2021
kube::codegen::gen_client \
2122
--boilerplate ${SDK_HACK_DIR}/boilerplate.go.kb.txt \
2223
--with-watch \
2324
--output-dir ${SDK_HACK_DIR}/../pkg/apis/client \
2425
--output-pkg github.com/NVIDIA/KAI-scheduler/pkg/apis/client \
2526
${SDK_HACK_DIR}/../pkg/apis
2627

27-
rm -f generate-dep.go && rm -r vendor && go mod tidy
28+
rm -f generate-dep.go && go mod tidy
2829

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

0 commit comments

Comments
 (0)