Skip to content

Commit

Permalink
use template when generating tempdir in verify-crds
Browse files Browse the repository at this point in the history
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] kubernetes-sigs/controller-tools#734

Signed-off-by: Ashley Davis <[email protected]>
  • Loading branch information
SgtCoDFish committed Jan 3, 2023
1 parent 2a7fabd commit c685efe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hack/check-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c685efe

Please sign in to comment.