ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.31k stars 1.24k forks source link

Add kubectl plugin installation to Homebrew formula #397

Closed justenstall closed 8 months ago

justenstall commented 11 months ago

Is there a reason the kubectx Homebrew formula only installs the binaries as kubectx and kubens? The following lines could be added to the formula to also install the binaries as kubectl plugins, and wouldn't create much overhead since Homebrew uses symlinks:

  def install
    bin.install "kubectx", "kubens" # already in formula

    bin.install "kubectx" => "kubectl-ctx"
    bin.install "kubens" => "kubectl-ns"
    ...
  end

If there isn't a reason against it, I can make a PR to the homebrew-core repo with the change.

ahmetb commented 11 months ago

Honestly not a bad idea but it might confuse people a bit regarding where these plugins are from if they also have Krew installed on their system but these plugins aren't showing up on kubectl krew list. (For example, I use krew for other plugins but not for kubectx/kubens.)

justenstall commented 11 months ago

I can understand that. Users could still list these plugins with kubectl plugin list if they are installed by Homebrew, which I think is the most "correct" way to check the available plugins. There is precedent for distributing the plugin form through Homebrew, kubelogin does this (their implementation is different than the snippet I have in the original issue and possibly more correct).

ahmetb commented 11 months ago

Yeah makes sense. Go for it, I see no harm except when this shadows krew installation for the same plugin and vice versa, but it's not a big deal.

justenstall commented 8 months ago

This was implemented with https://github.com/Homebrew/homebrew-core/pull/140831