-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CLI: it would be helpful to skip PROJECT reads for extra commands #1755
Comments
The CLI is fine if no project configuration file exists ( /cc @estroz |
This comment has been minimized.
This comment has been minimized.
@camilamacedo86 the error comes from the Now we have two solutions:
I was trying to evaluate how much work would the second approach need and evaluate if it was worth it. |
Hi @Adirio, I close my previous comment to not make it confusing. I checked with @jmrodri the scenario. Following the steps to reproduce:
It is considered the directory PROJECT as a file. We need only looking for a file with this name. |
Even a For example, consider an empty
Or another example where
There's no reason at all for |
It uses the project file to try to guess the project version and the plugin layout, which gets saved in that file. But I do agree that we may be able to move that check after we know that it is needed by the subcommand. Some validation from the CLI would need to be dropped though, like having plugins for the proper version as we won't be able to know the version of the project without reading the file. |
@Adirio i will check it out today. Thanks for the PR. |
With the patch from PR #1828 applied, this issue is fixed.
|
It would be helpful to skip
PROJECT
file reads for extra commands.kubebuilder version
will throw an error if an errantPROJECT
file exists. I do not expect this forversion
or other extra commands.For example,
I expected the
version
and extra commands to ignore thePROJECT
file/directory.To reproduce:
This also affects the
operator-sdk
because we use thekubebuilder
cli. I've tracked down some of the interaction. Starting fromcli.New
which always callsc.initialize()
. This fails with the following error:FATA[0000] failed to read config: read PROJECT: is a directory
because of the errantPROJECT
file. With most commands it is useful and/or required to read thePROJECT
file but for something likeversion
or other extra commands I believe it isn't required./kind bug
The text was updated successfully, but these errors were encountered: