-
Notifications
You must be signed in to change notification settings - Fork 689
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Search before asking
- I had searched in the issues and found no similar feature requirement.
Description
go list -m -f "{{.Dir}}" k8s.io/code-generator will get "" when go vendor is enabled.
$ ./hack/update-codegen.sh
is missing. Running 'go mod download'.
>> Using
./hack/update-codegen.sh: line 26: /kube_codegen.sh: No such file or directory
kuberay/ray-operator/hack/update-codegen.sh
Lines 14 to 20 in 4540f18
| CODEGEN_PKG=$(go list -m -f "{{.Dir}}" k8s.io/code-generator) | |
| if [[ ! -d ${CODEGEN_PKG} ]]; then | |
| echo "${CODEGEN_PKG} is missing. Running 'go mod download'." | |
| go mod download | |
| CODEGEN_PKG=$(go list -m -f "{{.Dir}}" k8s.io/code-generator) | |
| fi |
I think it would be beneficial to support Go vendor users as well. For reference, sample-controller handles this by setting:
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
We could keep both approaches here to support both Go vendor and non-vendor setups.
https://github.com/kubernetes/sample-controller/blob/master/hack/update-codegen.sh
Use case
No response
Related issues
No response
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request