Coder Social home page Coder Social logo

Comments (4)

sfxworks avatar sfxworks commented on May 27, 2024

Upon further inspection

total 0
drwxr-xr-x 2 sam sam 125 May 24 21:13 .
drwxr-xr-x 6 sam sam  59 May 13 22:53 ..
lrwxrwxrwx 1 sam sam  49 May 13 22:54 kubectl-change_ns -> /home/sam/.krew/store/change-ns/v1.0.0/kubectl-ns
lrwxrwxrwx 1 sam sam  38 May 13 22:53 kubectl-krew -> /home/sam/.krew/store/krew/v0.4.3/krew
lrwxrwxrwx 1 sam sam  51 May 24 21:13 kubectl-kubectl_ai -> /home/sam/.krew/store/kubectl-ai/v0.0.10/kubectl-ai
lrwxrwxrwx 1 sam sam  59 May 13 22:57 kubectl-rook_ceph -> /home/sam/.krew/store/rook-ceph/v0.4.0/kubectl-rook-ceph.sh
lrwxrwxrwx 1 sam sam  52 May 13 22:56 kubectl-who_can -> /home/sam/.krew/store/who-can/v0.4.0/kubectl-who-can

from kubectl-ai.

sfxworks avatar sfxworks commented on May 27, 2024

Looks like to fix this

  1. The generated binary would need to be renamed to ai instead of kubect-ai
  2. https://github.com/sozercan/kubectl-ai/blob/main/plugins/kubectl-ai.yaml would need to target said binary instead of kubect-ai

I could make a PR later after investigating your build process

from kubectl-ai.

sozercan avatar sozercan commented on May 27, 2024

@sfxworks thanks for the report! i can repro this behavior.

It seems like krew is trying to be clever by adding a kubectl- in front of the executable and then replacing - with _. Looks like normally this can be solved with specifying files to rename the binary.
https://krew.sigs.k8s.io/docs/developer-guide/plugin-manifest/

However, in this case, we are autogenerating the krew manifest using goreleaser (https://github.com/sozercan/kubectl-ai/blob/main/.goreleaser.yaml)
Unfortunately, I don't see a way in goreleaser to rename the binaries: https://goreleaser.com/customization/krew/

If we rename the binary to be just ai, it will break the other installation methods, like brew or archives.
Quickest workaround for this seems to be mv $HOME/.krew/bin/kubectl-kubectl_ai $HOME/.krew/bin/kubectl-ai (guessing this will need to be done after every upgrade ☚ī¸)
Another option is to add a new build for ai in goreleaser only to be used in krews.

Let me know if you find any other solutions or interested in contributing one of the workarounds.

from kubectl-ai.

sfxworks avatar sfxworks commented on May 27, 2024

If you're intent on using goreleaser, you may want to raise an issue in their PR requesting this feature. It looks like homebrew offers a post install scrip though that could conduct the rename if needed. A third option could be to switch to some prewritten github actions for homebrew and krew that already offer the features you'd need here. Krew is a popular plugin manager for kubectl, so I'd at least note the current post-install step required in the readme. I just adjusted the symlink myself (Mine was a symlink rather than the binary).

from kubectl-ai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.