From 3096b82482b42560e069fcfb92001bebc3eae548 Mon Sep 17 00:00:00 2001 From: Sridhar Gaddam Date: Fri, 7 Nov 2025 16:53:25 +0530 Subject: [PATCH] Fix make gen errors when vendor folder is present When vendor mode is enabled in this project, the command "go list" can return an empty string, causing errors while running "make gen" command. This PR modifies the command to use "-mod=readonly" which ensures the Go command properly resolves the module directory even when vendoring is in use. Signed-off-by: Sridhar Gaddam --- hack/extract-istio-crds.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/extract-istio-crds.sh b/hack/extract-istio-crds.sh index 6045c8a578..5333c369fc 100755 --- a/hack/extract-istio-crds.sh +++ b/hack/extract-istio-crds.sh @@ -16,10 +16,10 @@ set -euo pipefail -INPUT_FILE="$(go list -m -f '{{.Dir}}' istio.io/istio)/manifests/charts/base/files/crd-all.gen.yaml" +INPUT_FILE="$(go list -mod=readonly -m -f '{{.Dir}}' istio.io/istio)/manifests/charts/base/files/crd-all.gen.yaml" # check if the file exists and adjust the file path if necessary (this is needed because older Istio versions have the CRDs in a different location) if [ ! -f "${INPUT_FILE}" ]; then - INPUT_FILE="$(go list -m -f '{{.Dir}}' istio.io/istio)/manifests/charts/base/crds/crd-all.gen.yaml" + INPUT_FILE="$(go list -mod=readonly -m -f '{{.Dir}}' istio.io/istio)/manifests/charts/base/crds/crd-all.gen.yaml" fi SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )