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

make generate exit with error: unable to run pre-scaffold tasks, target directory is not empty, found existing file \"bin\" #3581

Closed
lowang-bh opened this issue Sep 3, 2023 · 1 comment · Fixed by #3582
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@lowang-bh
Copy link
Member

What broke? What's expected?

make generate

INFO[0000] refreshing tools and creating directory...
  cleaning up tools
  preparing testing directory: docs/book/src/component-config-tutorial/testdata/project/
INFO[0000] Initializing the component config project
  running: /tmp/kubebuilder/bin/kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io/project --license apache2 --owner The Kubernetes authors --plugins=go/v4 --component-config
ERRO[0000] error Initializing the component config project: /tmp/kubebuilder/bin/kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io/project --license apache2 --owner The Kubernetes authors --plugins=go/v4 --component-config failed with error: (exit status 1) Flag --component-config has been deprecated, the ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0. Moreover, it has undergone breaking changes and is no longer functioning as intended. As a result, this tool, which heavily relies on the Controller Runtime, has also deprecated this feature, no longer guaranteeing its functionality from version 3.11.0 onwards. You can find additional details on https://github.com/kubernetes-sigs/controller-runtime/issues/895.
Error: failed to initialize project: unable to run pre-scaffold tasks of "base.go.kubebuilder.io/v4": target directory is not empty (only go.mod, go.sum, files and directories with the prefix ".", files with the suffix ".md" or capitalized files name are allowed); found existing file "bin"
Usage:
  kubebuilder init [flags]

Examples:
  # Initialize a new project with your domain and name in copyright
  kubebuilder init --plugins go/v4 --domain example.org --owner "Your name"

  # Initialize a new project defining a specific project version
  kubebuilder init --plugins go/v4 --project-version 3


Flags:
      --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
      --project-version string   project version (default "3")
      --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 to be used for this subcommand execution

time="2023-09-03T18:42:34+08:00" level=fatal msg="failed to initialize project: unable to run pre-scaffold tasks of \"base.go.kubebuilder.io/v4\": target directory is not empty (only go.mod, go.sum, files and directories with the prefix \".\", files with the suffix \".md\" or capitalized files name are allowed); found existing file \"bin\""
exit status 1
make: *** [generate-docs] Error 1

check the dir

 ls -l docs/book/src/cronjob-tutorial/testdata/project/bin
total 155848
-rwxr-xr-x  1 wlh  staff  20979154  9  3 18:46 controller-gen
drwxr-xr-x  3 wlh  staff        96  9  3 18:50 k8s
-rwxr-xr-x  1 wlh  staff  50863778  9  3 18:46 manager
-rwxr-xr-x  1 wlh  staff   7949730  9  3 18:49 setup-envtest

Reproducing this issue

master branch

KubeBuilder (CLI) Version

Version: main.version{KubeBuilderVersion:"v3.0.0-alpha.0-1370-gb10177e9", KubernetesVendor:"unknown", GitCommit:"b10177e9c5c9c672f6c8c52b25a61d713369a58d", BuildDate:"2023-09-03T09:47:10Z", GoOs:"darwin", GoArch:"arm64"}

PROJECT version

none

Plugin versions

none

Other versions

go version go1.20.1 darwin/arm64

Extra Labels

No response

@lowang-bh lowang-bh added the kind/bug Categorizes issue or PR as related to a bug. label Sep 3, 2023
@lowang-bh
Copy link
Member Author

/assign

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

Successfully merging a pull request may close this issue.

1 participant