Controller-gen randomly fails for filenames from mktemp #5271
Labels
contribfest
Issue to be worked on during ContribFest @ KubeCon EU 2023.
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/bug
Categorizes issue or PR as related to a bug.
What steps did you take and what happened:
Compiling Contour sometimes fails when running
make generate
. The error can look something like thisThis error was from MacOS and
/var/folders/zz/xyz
base path is coming from _CS_DARWIN_USER_TEMP_DIR (link). Depending on users (bad) luck, it might be interpreted as invalid digit like08
(link) in this example and the generation will fail. When this happens, it is 100% reproducible since user's temp base dir does not change between executions.Another example is from Linux.
mktemp
will sometimes generate filename that is interpreted as hexadecimal floating point numbers (link). It will happen very rarely, and the chances are that next run it will not fail. Error might look like following:What did you expect to happen:
Compiling should not fail.
Anything else you would like to add:
There is a limitation in controller-tools that causes the filename to be interpreted as digit kubernetes-sigs/controller-tools#734
During Contour build we are running
controller-gen
for a filename that is created bymktemp
- which can generate files that look like invalid digitscontour/hack/generate-crd-deepcopy.sh
Lines 37 to 44 in 4e82e78
There was previous attempt #5119 fixing similar problem.
It would be great if build did not depend on
mktemp
for filenames that are sent to controller-tools. The same issue applies bothhack/generate-crd-deepcopy.sh
andhack/generate-crd-yaml.sh
The text was updated successfully, but these errors were encountered: