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

Makefile scaffolding should generate target to install Kustomize with go install #2822

Closed
erikgb opened this issue Jul 12, 2022 · 17 comments · Fixed by #3398
Closed

Makefile scaffolding should generate target to install Kustomize with go install #2822

erikgb opened this issue Jul 12, 2022 · 17 comments · Fixed by #3398
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@erikgb
Copy link
Contributor

erikgb commented Jul 12, 2022

What do you want to happen?

Since version 4.5.2, Kustomize supports installation with go install, ref. kubernetes-sigs/kustomize#3618. As a workaround we used the official install script in #2486.

Motivation: Even if using the official Kustomize install script, I try to avoid executing remotely downloaded shell scripts.

Extra Labels

/kind cleanup

@erikgb erikgb added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 12, 2022
@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jul 12, 2022
@camilamacedo86
Copy link
Member

camilamacedo86 commented Jul 12, 2022

Hi @erikgb,

By default Kubebuilder scaffolds the Bundle go/v3 which cannot begin to use kustomize v4. It is a breaking change for the stable plugin. More info

Then, we cannot get the kustomize v3 used in the default scaffolds with go install. We can only change it for the next version (go/v4-alpha) which is using this version. In this way, I am adding this one to the go/v4 milestone.

To know more about the plugins see: https://book.kubebuilder.io/plugins/plugins.html

@camilamacedo86 camilamacedo86 added this to the go/v4 milestone Jul 12, 2022
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 1, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2531
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 2, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2822
camilamacedo86 added a commit to camilamacedo86/kubebuilder that referenced this issue Oct 2, 2022
…munity in the layout

- Add a new golang language base plugin (base.go/v4)
- Change the go/v4-alpha plugin to use the new base
- Address the layout changes requirements for go/v4. Now, the api and controllers are under the pkg dir.
- Change the Makefile to install kustomize with go install
- Remove crdVersion and webhook versions that is not supported and should no longer be served.

Closes: kubernetes-sigs#932
Closes: kubernetes-sigs#2822
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please 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 Oct 10, 2022
@camilamacedo86 camilamacedo86 removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 22, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please 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 Jan 20, 2023
@erikgb
Copy link
Contributor Author

erikgb commented Jan 20, 2023

/remove-lifecycle stale

Still relevant

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 20, 2023
@camilamacedo86 camilamacedo86 added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Jan 20, 2023
@Sajiyah-Salat
Copy link
Contributor

Hello @camilamacedo86 from above conversation it does not look like a good first issue. you have added good first issue label after long time. Can I know how this is a good first issue?

@camilamacedo86
Copy link
Member

Yes, you can. Please feel free to check this one.

@camilamacedo86 camilamacedo86 added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Feb 11, 2023
@Sajiyah-Salat
Copy link
Contributor

I think there should be a link in this keyword.

@camilamacedo86
Copy link
Member

camilamacedo86 commented Feb 12, 2023

The changes must be done in : https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go#L198-L206

You will do the change and run make generate to ensure that all samples under testdata are updated properly to push the PR.

@Sajiyah-Salat
Copy link
Contributor

The above info was a little hard to process. I got that go get can't be used we need to add go install in updated version of kubebuilder. controller-gen have go install. Do I need to change like that?

@lakshya8066
Copy link

/assign

@ashutosh887
Copy link
Contributor

@lakshya8066 If you are not able to resolve this, I would like to take this up @camilamacedo86

@Sajiyah-Salat
Copy link
Contributor

The above info was a little hard to process. I got that go get can't be used we need to add go install in updated version of kubebuilder. controller-gen have go install. Do I need to change like that?

it may sound dumb. but can I get reply or reviews on this. i am eager to contribute here. help me.

@erikgb
Copy link
Contributor Author

erikgb commented Feb 27, 2023

The above info was a little hard to process. I got that go get can't be used we need to add go install in updated version of kubebuilder. controller-gen have go install. Do I need to change like that?

it may sound dumb. but can I get reply or reviews on this. i am eager to contribute here. help me.

Not sure if I understand the question, but I assume using a similar approach that for the other CLI tools installations using go install would work (like controller-gen).

@Sajiyah-Salat
Copy link
Contributor

Thank you @erikgb for your reply.

@Sajiyah-Salat
Copy link
Contributor

The above info was a little hard to process. I got that go get can't be used we need to add go install in updated version of kubebuilder. controller-gen have go install. Do I need to change like that?

Hello @camilamacedo86 need your reviews.

@camilamacedo86
Copy link
Member

camilamacedo86 commented Mar 7, 2023

The scope for this task is only change how we obtain / install kustomize.
The idea is to use go install instead of the shell script only for go/v4 scaffold.

See the target:

https://github.com/kubernetes-sigs/kubebuilder/blob/master/testdata/project-v4/Makefile#L138-L146

Then, see where the code changes should be done:

https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go#L198-L206

Therefore, we should not touch in the controller-gen target at all to do this one.
I am not sure if we can use go install to obtain controller-gen but anyway that is not part of the scope of this issue.

You can check here: https://kubectl.docs.kubernetes.io/installation/kustomize/source/ how we can install kustomize using the go install instead.

@lauchokyip
Copy link
Contributor

lauchokyip commented May 8, 2023

/assign

Will tackle this one 😃, expecting a PR within 2 weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
8 participants