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

Is it possible to install only controller-gen library? #520

Closed
LAnastasiia opened this issue Nov 13, 2020 · 9 comments
Closed

Is it possible to install only controller-gen library? #520

LAnastasiia opened this issue Nov 13, 2020 · 9 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@LAnastasiia
Copy link

Hi! Is it possible to use controller-gen CLI without using kubebuilder?

If yes, how can I install it?
I couldn't find any installation guidelines for controller-gen exclusively. Is there one? (or really any pointer on how to do it would be appreciated)

More context:
Environment does not support kubebuilder integration yet, but does support controller-tools.
From https://book.kubebuilder.io/reference/controller-gen.html#controller-gen-cli it looks like controller-gen covers the need of scaffolding for the project completely. But although I have kubebuilder installed, the controller-gen command can not be found. So I'm looking for a way to install it separately.

Thank you!

@estroz
Copy link
Contributor

estroz commented Dec 1, 2020

You can import things in pkg/ to run generators. controller-gen's main.go is a good (the best?) implementation to reference.

@prashao
Copy link

prashao commented Jan 20, 2021

@LAnastasiia To install just the controller-gen binary you can do the following -

  1. GOPATH env var should be set
  2. export GO111MODULE=on
  3. go get sigs.k8s.io/controller-tools/cmd/[email protected]

This will install controller-gen v0.4.1 binary in your GOPATH/bin directory.

@camilamacedo86
Copy link
Member

camilamacedo86 commented Jan 21, 2021

@prashao and @LAnastasiia,

Btw kubebuilder also scaffolds the same install in the Makefile. See; https://github.com/kubernetes-sigs/kubebuilder/blob/master/testdata/project-v3/Makefile#L81-L83

WDYT about we add the install instruction in the README? Would you like to push a PR for that?

Regards:

But although I have kubebuilder installed, the controller-gen command can not be found. So I'm looking for a way to install it separately.

Could you please raise an issue in Kuebuilder repo? Also, please add the Makefile and the version and etc that you are using for we are able to better check that. If it is not working for you we need to see how to fix.

@prashao
Copy link

prashao commented Jan 21, 2021

@camilamacedo86
Yeah I'll create a PR to update the README to install standalone controller-gen binary.

@prashao
Copy link

prashao commented Jan 21, 2021

@camilamacedo86
Have created PR #537

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 21, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 21, 2021
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants