kubebuilder icon indicating copy to clipboard operation
kubebuilder copied to clipboard

Makefile scaffolding should generate target to install Kustomize with go install

Open erikgb opened this issue 2 years ago • 2 comments

What do you want to happen?

Since version 4.5.2, Kustomize supports installation with go install, ref. https://github.com/kubernetes-sigs/kustomize/issues/3618. As a workaround we used the official install script in https://github.com/kubernetes-sigs/kubebuilder/pull/2486.

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

Extra Labels

/kind cleanup

erikgb avatar Jul 12 '22 20:07 erikgb

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 avatar Jul 12 '22 21:07 camilamacedo86

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-triage-robot avatar Oct 10 '22 21:10 k8s-triage-robot

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-triage-robot avatar Jan 20 '23 09:01 k8s-triage-robot

/remove-lifecycle stale

Still relevant

erikgb avatar Jan 20 '23 09:01 erikgb

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?

Sajiyah-Salat avatar Jan 31 '23 12:01 Sajiyah-Salat

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

camilamacedo86 avatar Feb 11 '23 15:02 camilamacedo86

I think there should be a link in this keyword.

Sajiyah-Salat avatar Feb 12 '23 00:02 Sajiyah-Salat

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.

camilamacedo86 avatar Feb 12 '23 17:02 camilamacedo86

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?

Sajiyah-Salat avatar Feb 13 '23 01:02 Sajiyah-Salat

/assign

lakshya8066 avatar Feb 13 '23 14:02 lakshya8066

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

ashutosh887 avatar Feb 26 '23 09:02 ashutosh887

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.

Sajiyah-Salat avatar Feb 27 '23 02:02 Sajiyah-Salat

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).

erikgb avatar Feb 27 '23 07:02 erikgb

Thank you @erikgb for your reply.

Sajiyah-Salat avatar Feb 28 '23 02:02 Sajiyah-Salat

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.

Sajiyah-Salat avatar Mar 07 '23 11:03 Sajiyah-Salat

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.

camilamacedo86 avatar Mar 07 '23 12:03 camilamacedo86

/assign

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

lauchokyip avatar May 08 '23 14:05 lauchokyip