operator-framework/java-operator-plugins

Running `init` in a directory that is already under git control fails

metacosm opened this issue · 1 comments

Bug Report

If you try to run init on an initialized git repository that doesn't contain a .gitignore, the command will fail with
FATA[0000] failed to initialize project: unable to scaffold with "quarkus.javaoperatorsdk.io/v1-alpha": open .gitignore: no such file or directory

What did you do?

Create a new repository, cd to it, run git init then operator-sdk init --plugins quarkus --domain example.com --project-name foo

What did you expect to see?

An initialized project.

What did you see instead? Under which circumstances?

Failure

Environment

Operator type:

/language java

Kubernetes cluster type:

$ operator-sdk version

operator-sdk version: "v1.10.0", commit: "c247d4b4142cd7736f122796e3388fbd05f62b71", kubernetes version: "v1.20.2", go version: "go1.16.6", GOOS: "darwin", GOARCH: "amd64"

$ java -version (if language is Java)

Doesn't matter.

$ kubectl version

doesn't matter

Actually, this was a manipulation error on my side: I had deleted the parent dir and re-created it in a different shell, which meant that even though things were supposed to have not changed, they actually had, resulting in the shell (and therefore go) not being able to open the files anymore. Solution was to cd out of the directory and cd back in.