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

feat: added versioned validation and installation of controller-gen #1618

Conversation

yashvardhan-kukreja
Copy link
Contributor

Signed-off-by: Yashvardhan Kukreja yash.kukreja.98@gmail.com

Related issue

closes #1617

What type of PR is this

/kind feature
/kind bug

Proposed changes

From now on, whenever the user will run make controller-gen, it will be made sure that they end up specifically with v0.4.0 (currently) of controller-gen.

Checklist

Further comments

Here's an example of it working:

  1. User doesn't have controller-gen installed
► make controller-gen
controller-gen not found!
installing controller-gen v0.4.0...
make[1]: Entering directory '/home/yash1300/Projects/GoProjects/github.com/yashvardhan-kukreja/kyverno'
go: creating new go.mod: module tmp
go: found sigs.k8s.io/controller-tools/cmd/controller-gen in sigs.k8s.io/controller-tools v0.4.0
CONTROLLER_GEN=/home/yash1300/Projects/GoProjects/bin/controller-gen
make[1]: Leaving directory '/home/yash1300/Projects/GoProjects/github.com/yashvardhan-kukreja/kyverno'
  1. User has controller-gen installed but with some different version (0.2.5 for eg:)
► make controller-gen
controller-gen Version: v0.2.5 found!
required controller-gen v0.4.0
installing controller-gen v0.4.0...
make[1]: Entering directory '/home/yash1300/Projects/GoProjects/github.com/yashvardhan-kukreja/kyverno'
go: creating new go.mod: module tmp
go: found sigs.k8s.io/controller-tools/cmd/controller-gen in sigs.k8s.io/controller-tools v0.4.0
CONTROLLER_GEN=/home/yash1300/Projects/GoProjects/bin/controller-gen
make[1]: Leaving directory '/home/yash1300/Projects/GoProjects/github.com/yashvardhan-kukreja/kyverno'
  1. User has controller-gen v0.4.0 installed
► make controller-gen
make: Nothing to be done for 'controller-gen'.

@yashvardhan-kukreja
Copy link
Contributor Author

ptal @realshuting

Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
@yashvardhan-kukreja yashvardhan-kukreja force-pushed the issue-1617/version-enforcement-over-make-controller-gen branch from 8c07554 to 7ffb30c Compare February 17, 2021 21:08
Copy link
Member

@realshuting realshuting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@realshuting realshuting merged commit ba9d294 into kyverno:main Feb 19, 2021
vyankyGH pushed a commit to vyankyGH/kyverno that referenced this pull request Feb 23, 2021
…yverno#1618)

Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
Signed-off-by: vyankatesh <vyankatesh@neualto.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants