From e89b6d46aa0a9758e22db724136e16d0b6074079 Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Mon, 22 Jan 2024 13:33:11 -0800 Subject: [PATCH 1/2] Add more debugging log on generating crd related code. So it would be useful Signed-off-by: Lubron Zhan --- hack/actions/check-uncommitted-codegen.sh | 1 + hack/generate-crd-deepcopy.sh | 3 +++ hack/generate-crd-yaml.sh | 3 +++ hack/generate-rbac.sh | 3 +++ 4 files changed, 10 insertions(+) diff --git a/hack/actions/check-uncommitted-codegen.sh b/hack/actions/check-uncommitted-codegen.sh index 8d62ff14aeb..b4d36ecd299 100755 --- a/hack/actions/check-uncommitted-codegen.sh +++ b/hack/actions/check-uncommitted-codegen.sh @@ -24,5 +24,6 @@ if git status -s ${TARGETS[@]} 2>&1 | grep -E -q '^\s+[MADRCU]' then echo Uncommitted changes in generated sources: git status -s ${TARGETS[@]} + git diff exit 1 fi diff --git a/hack/generate-crd-deepcopy.sh b/hack/generate-crd-deepcopy.sh index ccad3c77a7d..6778189c4cd 100755 --- a/hack/generate-crd-deepcopy.sh +++ b/hack/generate-crd-deepcopy.sh @@ -38,6 +38,9 @@ readonly HEADER=$(mktemp) boilerplate > "${HEADER}" +exec echo "controller-gen version: " +exec go run sigs.k8s.io/controller-tools/cmd/controller-gen --version + exec go run sigs.k8s.io/controller-tools/cmd/controller-gen \ "object:headerFile=${HEADER}" \ "paths=${PATHS}" diff --git a/hack/generate-crd-yaml.sh b/hack/generate-crd-yaml.sh index ef46631b6e8..4ffc3a32613 100755 --- a/hack/generate-crd-yaml.sh +++ b/hack/generate-crd-yaml.sh @@ -15,6 +15,9 @@ trap 'rm -rf "$TEMPDIR"; exit' 0 1 2 15 cd "${REPO}" +echo "controller-gen version: " +go run sigs.k8s.io/controller-tools/cmd/controller-gen --version + # Controller-gen seems to use an unstable sort for the order of output of the CRDs # so, output them to separate files, then concatenate those files. # That should give a stable sort. diff --git a/hack/generate-rbac.sh b/hack/generate-rbac.sh index c8e854c5a94..3160afa6775 100755 --- a/hack/generate-rbac.sh +++ b/hack/generate-rbac.sh @@ -17,6 +17,9 @@ cat > "${REPO}/examples/contour/02-role-contour.yaml" < Date: Mon, 22 Jan 2024 18:27:07 -0800 Subject: [PATCH 2/2] Resolve comments Signed-off-by: Lubron Zhan --- hack/actions/check-uncommitted-codegen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/actions/check-uncommitted-codegen.sh b/hack/actions/check-uncommitted-codegen.sh index b4d36ecd299..7d6e7149b9d 100755 --- a/hack/actions/check-uncommitted-codegen.sh +++ b/hack/actions/check-uncommitted-codegen.sh @@ -24,6 +24,6 @@ if git status -s ${TARGETS[@]} 2>&1 | grep -E -q '^\s+[MADRCU]' then echo Uncommitted changes in generated sources: git status -s ${TARGETS[@]} - git diff + git --no-pager diff exit 1 fi