From 157a70b1046617da9a85705dacd07daad05bcccb Mon Sep 17 00:00:00 2001 From: Ashley Davis Date: Tue, 3 Jan 2023 15:10:42 +0000 Subject: [PATCH] use template when generating tempdir in verify-crds Due to a bug in controller-gen[1] certain paths are incorrectly split and part of these paths can be interpreted as a numeric literal, which will cause controller-gen to fail. We observe this as occasional test flakes in the "verify-crds" target, when the tmpdir starts with a zero, such as in "/tmp/tmp.0PFqFSHBID" This commit attempts to avoid this bug by specifying a template for the tmpdir we generate when verifying CRDs which doesn't include any "." characters, which seem to be being split incorrectly. [1] https://github.com/kubernetes-sigs/controller-tools/issues/734 Signed-off-by: Ashley Davis --- hack/check-crds.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/check-crds.sh b/hack/check-crds.sh index 232cc5fd797..c4d26961ee3 100755 --- a/hack/check-crds.sh +++ b/hack/check-crds.sh @@ -41,7 +41,7 @@ fi echo "+++ verifying that generated CRDs are up-to-date..." >&2 -tmpdir="$(mktemp -d)" +tmpdir="$(mktemp -d tmp-CHECKCRD-XXXXXXXXX --tmpdir)" trap 'rm -r $tmpdir' EXIT make PATCH_CRD_OUTPUT_DIR=$tmpdir patch-crds