kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

Refactor: Use `go tool` instead of `go install` when executing internal CLI tools

Open koba1t opened this issue 4 months ago • 3 comments

About

During development, execute the internal CLI binary without installing it locally, but rather via go tool. Specifically, consolidate the installation and execution of binaries run via makefiles, shell scripts, etc., into a single CLI call through go tool

This eliminates the need to install binaries via go install each time, and can potentially prevent issues like using outdated versions of tools installed in your computer's GOBIN.

How to migrate

  • Since each CLI tool is called from shell scripts, go generate, or Makefiles, replace the invocations with go tool BINARY_NAME.
  • Locate and remove all instances where CLI tools are being go installed.
  • Verify that the CLI can be called

Tools List

in repo tools

  • [x] gorepomod https://github.com/kubernetes-sigs/kustomize/pull/5963
  • [ ] mdtogo
  • [ ] pluginator

external tools

  • [ ] golangci-lint
  • [ ] mdrip
  • [ ] stringer
  • [ ] goimports
  • [ ] mdtogo
  • [ ] addlicense
  • [ ] kind
  • [ ] controller-gen
  • [ ] embedmd
  • [ ] go-bindata
  • [ ] go-apidiff
  • [ ] gh
  • [ ] kubeval

koba1t avatar Aug 27 '25 20:08 koba1t

/triage accepted /kind cleanup

stormqueen1990 avatar Aug 27 '25 21:08 stormqueen1990

I came across this issue and would love to contribute could you please assign it to me?

aryasoni98 avatar Oct 05 '25 07:10 aryasoni98

Hi @aryasoni98 Thank you for your contribution!

Since this is an issue for planning multiple tool migrations, I intended to create separate sub-issues for each tool. I created a sub-issue for migrating the k8scopy CLI tool and assigned you to it.

koba1t avatar Oct 06 '25 20:10 koba1t