Skip to content
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

Failed to initialize project in a new github repo #2004

Closed
jmrodri opened this issue Feb 10, 2021 · 4 comments · Fixed by #2014
Closed

Failed to initialize project in a new github repo #2004

jmrodri opened this issue Feb 10, 2021 · 4 comments · Fixed by #2014
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@jmrodri
Copy link
Contributor

jmrodri commented Feb 10, 2021

Can not initialize a project if LICENSE and README exist. Relates to Issue #1971

...
2021/02/10 10:34:18 failed to initialize project with "go.kubebuilder.io/v3": target directory is not empty (only go.mod, go.sum, and files and directories with the prefix "." are allowed); found existing file "LICENSE"

I expected it to create the project since it's basically an empty repo. If I create a git repo in github using their UI and choose to add a license, readme and .gitignore, so I can seed a new operator project, I can't do this.

  • Go to github, create a new repository
  • In the *Create a new repository" screen choose the following options:
    • Add a README file
    • Add .gitignore, select .gitignore template: Go
    • Choose a license, select Apache License 2.0
  • Click Create repository
  • Clone new repository
  • cd to new project
  • kubebuilder init --domain example.com --repo github.com/USER/YOURNEWREPO
    create-github-repo
[jesusr@camaro dev]$ git clone git@github.com:jmrodri/fakerepo.git
Cloning into 'fakerepo'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (5/5), 4.72 KiB | 2.36 MiB/s, done.
[jesusr@camaro dev]$ cd fakerepo/
[jesusr@camaro fakerepo{main}]$ ls
LICENSE  README.md
[jesusr@camaro fakerepo{main}]$ kubebuilder init --domain zeusville.com --repo github.com/jmrodri/fakerepo
Error: failed to initialize project with "go.kubebuilder.io/v3": target directory is not empty (only go.mod, go.sum, and files and directories with the prefix "." are allowed); found existing file "LICENSE"
Usage:
  kubebuilder init [flags]

Examples:
  # Scaffold a project using the apache2 license with "The Kubernetes authors" as owners
  kubebuilder init --project-version=2 --domain example.org --license apache2 --owner "The Kubernetes authors"


Flags:
      --component-config        create a versioned ComponentConfig file, may be 'true' or 'false'
      --domain string           domain for groups (default "my.domain")
      --fetch-deps              ensure dependencies are downloaded (default true)
  -h, --help                    help for init
      --license string          license to use to boilerplate, may be one of 'apache2', 'none' (default "apache2")
      --owner string            owner to add to the copyright
      --project-name string     name of this project
      --repo string             name to use for go module (e.g., github.com/user/repo), defaults to the go package of the current working directory.
      --skip-go-version-check   if specified, skip checking the Go version

Global Flags:
      --plugins strings          plugin keys of the plugin to initialize the project with
      --project-version string   project version

2021/02/10 10:34:18 failed to initialize project with "go.kubebuilder.io/v3": target directory is not empty (only go.mod, go.sum, and files and directories with the prefix "." are allowed); found existing file "LICENSE"

Using kubebuilder from master branch.

$ kubebuilder version
Version: main.version{KubeBuilderVersion:"v3.0.0-alpha.0-78-g72f01e58", KubernetesVendor:"unknown", GitCommit:"72f01e58c677219d7af38385a1b249b496391167", BuildDate:"2021-02-10T14:10:30Z", GoOs:"linux", GoArch:"amd64"}
$ go version
go version go1.15.6 linux/amd64

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 10, 2021
@Adirio
Copy link
Contributor

Adirio commented Feb 13, 2021

I would say that this is more of a feature request than a bug. Change it back if you don't agree.
/remove-kind bug
/kind feature

By the way, I think this would be a good idea and it can easily be merged before v3.0.0.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Feb 13, 2021
@camilamacedo86
Copy link
Member

+1 for we move forward with this one.

@Adirio
Copy link
Contributor

Adirio commented Feb 13, 2021

I can take it if none of you is working on it right now

@Adirio
Copy link
Contributor

Adirio commented Feb 13, 2021

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants