-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
controller-gen interprets path as numeric literal and fails #734
Comments
We've just seen a similar (but slightly different) issue when testing cert-manager, where a standard tmpdir was interpreted as a hexadecimal floating point number: $ /home/prow/go/src/github.com/cert-manager/cert-manager/_bin/tools/controller-gen \
schemapatch:manifests=./deploy/crds \
output:dir=/tmp/tmp.4paHkdEcpK \
paths=./pkg/apis/...
Error: unable to parse option "output:dir=/tmp/tmp.4paHkdEcpK": ['p' exponent requires hexadecimal mantissa (at <input>:1:9) exponent has no digits (at <input>:1:9)] The tmpdir was generated by a simple edit: This was using controller-gen v0.10.0 installed via |
Hi @SgtCoDFish, What changes in the spec were made for the error began to be faced? We need to ensure that it is not a bug/issue introduced in the github.com/cert-manager project. |
I can reliably reproduce using these steps: # latest checkout of cert-manager
git clone [email protected]:cert-manager/cert-manager.git && cd cert-manager
# install controller-gen v0.10.0 using "go install" - the make command is complicated but it's just running "go install"
make _bin/downloaded/tools/[email protected]_linux_amd64
# create tmpdir which caused the failure
mkdir -p /tmp/tmp.4paHkdEcpK
# run command as above
./_bin/downloaded/tools/[email protected]_linux_amd64 schemapatch:manifests=./deploy/crds \
output:dir=/tmp/tmp.4paHkdEcpK \
paths=./pkg/apis/... This is a completely unmodified controller-gen at v0.10.0. The next test run worked successfully with the same command, same files, just a differently named tmpdir:
We run controller-gen in this way on every PR raised against cert-manager, and I haven't personally seen this error before but I'd bet it's reliably common with certain named tmpdirs. |
In my case, this is not related to cert-manager at all, as this is a locally developed controller. |
Hi @Jean-Daniel, So the problem here is that controller-gen is unable to generate the files when the output is like |
I can reproduce the issue with git clone [email protected]:cert-manager/cert-manager.git && cd cert-manager
make _bin/downloaded/tools/[email protected]_linux_amd64
mkdir -p /tmp/087bdd_s6vd1j_jkk244w5bm0000g
./_bin/downloaded/tools/[email protected]_linux_amd64 schemapatch:manifests=./deploy/crds \
output:dir=/tmp/087bdd_s6vd1j_jkk244w5bm0000g \
paths=./pkg/apis/... Output:
The cert-manager job works as expected if I use a tmpdir called |
|
Would you like to working on this change? If so, please feel free to push a PR. |
I have the same problem
got the following errors:
The pattern of problems seems to be {number}p |
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]>
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]>
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]>
Workaround for the following controller-gen issue: kubernetes-sigs/controller-tools#734 Signed-off-by: Steve Kriss <[email protected]>
Workaround for the following controller-gen issue: kubernetes-sigs/controller-tools#734 Signed-off-by: Steve Kriss <[email protected]>
Workaround for the following controller-gen issue: kubernetes-sigs/controller-tools#734 Signed-off-by: Steve Kriss <[email protected]>
Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]>
Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]>
[ upstream commit db3e015 ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]> Signed-off-by: Jussi Maki <[email protected]>
[ upstream commit db3e015 ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]> Signed-off-by: Jussi Maki <[email protected]>
[ upstream commit db3e015 ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]> Signed-off-by: Jussi Maki <[email protected]>
[ upstream commit db3e015 ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]> Signed-off-by: Jussi Maki <[email protected]>
[ upstream commit db3e015 ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]> Signed-off-by: Jussi Maki <[email protected]>
[ upstream commit db3e015 ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]> Signed-off-by: Jussi Maki <[email protected]> Signed-off-by: Yutaro Hayakawa <[email protected]>
[ upstream commit db3e015 ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]> Signed-off-by: Jussi Maki <[email protected]> Signed-off-by: Yutaro Hayakawa <[email protected]>
[ upstream commit db3e015 ] Before this patch, we would hit a controller-gen[1] bug when the temporary file would be of the form tmp.0oXXXXXX. This patch uses a custom mktemp template that will not trigger the bug. [1]: kubernetes-sigs/controller-tools#734 Signed-off-by: Alexandre Perrin <[email protected]> Signed-off-by: Jussi Maki <[email protected]> Signed-off-by: Yutaro Hayakawa <[email protected]>
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]>
When trying to run
controller-gen
, it fails with the following error, just because the path contains a dir with a name starting by 0.The text was updated successfully, but these errors were encountered: