-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Error: error reading configuration: open PROJECT: no such file or directory #3998
Comments
Hi @b1zzu, Shows that you are trying to use SDK CLI version 1.0+ with a project which was not migrated to the new layout. You need to migrate your projects see: https://sdk.operatorframework.io/docs/building-operators/helm/migration/ |
Closing it as solved. However, please feel free to ping us to re-open if you need it. |
Re-opening for a bit more discussion because I've seen this question come up a few times. @camilamacedo86 Can we investigate why that command needs a |
Hi @joelanford, It is fine. See that the PROJECT file is a requirement for the CLI and then, IMO it should NOT change to keep the consistency across the types as well. It has the project config that is used for example to run the commands such as:
In the f2f, we spoke about re-create the projects based on the PROJECT file which could bring facilities such as provide a tool to make easier the process to migrate the versions. By storing all data in the PROJECT file it could be easily achieved. PS.: Change it would probably mean no longer be able to use the CLI implementation from kb/upstream. |
Some SDK subcommands don't require the PROJECT file (e.g. Is there a workaround we can suggest? (e.g. create a PROJECT file and add some minimal set of info that is required). One of the goals of operator-sdk v1.0 was to make many of the extra subcommands usable outside the standard project structure, so I'm wondering if we think this command is inextricably tied to the project structure or if it could be run standalone. Looking at the flags exposed by the |
Hi @b1zzu, I got the @joelanford point. If you are looking for only run
However, if you would like to use all commands/features described in the docs you still need to migrate your project for the new layout: https://sdk.operatorframework.io/docs/building-operators/helm/migration/. Also, after chatting with @joelanford we might want to facilitate it for no longer be required the workaround so let's use this issue to track this need and see how we can approve it. |
@estroz: GitHub didn't allow me to assign the following users: anmol372. Note that only operator-framework members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi, |
Hi @estroz, Just to clarifies based on the tests made so far:
Regards the solution, I have a concern and a point to raise. See that if the layout is not in the PROJECT file the stamp used will be : In this way, one of the possible solutions that I'd like to suggest is we ask for the user input the type when the PROJECT file is not found such as we do to ask if the users would like to create the controller and the resource when we run $ operator-sdk generate kustomize manifests
Informe your project language [helm/ansible/go/other] c/c @joelanford |
@joelanford one thing I noticed is that just about everything looks at the PROJECT file first, like https://github.com/operator-framework/operator-sdk/blob/master/internal/cmd/operator-sdk/cli/cli.go#L50 I created a
version doesn't use anything from PROJECT. |
@jmrodri That error is slightly different than the one in this issue. If you don't have a PROJECT file at all, the SDK commands that don't actually require anything from it should work. That's what this issue is about. If you have a |
So running When we call operator-sdk.cli.Run() is called and calls That all happens BEFORE we call So I think it's not just "extracommands" that are affected. EVERY command looks at the |
The TL;DR is that I believe my comment #3998 (comment) is completely related because it's a command that does NOT need to look at the PROJECT file. Or at least it shouldn't FAIL if it's invalid. |
The I agree that we should look to see if we can skip that part for ExtraCommands. |
@jmrodri can you file a kubebuilder issue for skipping |
kubebuilder issue to skip |
I was checking this one further and shows that Kubebuilder does not require the PROJECT file for extra commands at all. See that it will not raise an issue when the file do not exist: https://github.com/kubernetes-sigs/kubebuilder/blob/76e8d21fd0efb89eb7de53bd7b48a1c70c3771d7/pkg/cli/cli.go#L187-L191 The error operator-sdk/internal/cmd/operator-sdk/generate/kustomize/manifests.go Lines 97 to 100 in bbc2f25
PS.: I am unable to reproduce
IMO what we can do here to solve this issue is as described in #3998 (comment) is:
$ operator-sdk generate kustomize manifests OR We can fill the stamp with a generic value which means undefined. Then, we do not need the PROJECT file at all. |
Running into the same issue in operator-sdk version: v1.4.0: When running
it returns
Am I doing something incorrectly? Or was it decided that we should create a PROJECT file in the root dir to get around the error? (e.g. operator-sdk version
kubectl version
|
This was supposed to have been fixed by #4074 but on further inspection was not. I'll patch this. /reopen |
@estroz: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
On second thought:
I'm going to re-close this since |
Bug Report
What did you do?
I'm trying to follow the Generating Manifests and Metadata tutorial, and I've executed the kustomize generator cmd in an empty directory:
What did you expect to see?
I expected the cmd to ask for the missing information and generate the
kustomization.yaml
and the.clusterserviceversion.yaml
filesWhat did you see instead? Under which circumstances?
The cmd returned this error:
Environment
Operator type:
/language helm
Kubernetes cluster type:
$ operator-sdk version
$ kubectl version
The text was updated successfully, but these errors were encountered: