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

feat: krew plugin workflow #214

Merged
merged 3 commits into from Mar 3, 2024
Merged

feat: krew plugin workflow #214

merged 3 commits into from Mar 3, 2024

Conversation

doronkg
Copy link
Contributor

@doronkg doronkg commented Feb 29, 2024

This PR resolves #209.

  • README.md - instructions for installing kor as a kubectl plugin with krew.
  • cmd/kor/root.go - revise usage & help messages with kubectl- prefix, see best practices.
  • .krew.yaml - krew plugin manifest using release version templating.
  • .github/workflows/release.yml - automate plugin updates in krew-index, see krew-release-bot.

The mentioned below manifest will be initially submitted to krew-index under plugins/kor.yaml.

I've tested it locally for all OS types, using the following example command:

$ KREW_OS=windows KREW_ARCH=amd64 kubectl krew install --manifest=kor.yaml
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
  name: kor
spec:
  version: v0.3.5
  homepage: https://github.com/yonahd/kor
  shortDescription: Kor is a tool to discover unused K8s resources.
  description: |
    This plugin shows unused Kubernetes resources (namespaced or cluster-scoped).
    It provides additional capabilities such as exporting Prometheus metrics,
    deleting unused resources, and more!
  platforms:
  - selector:
      matchLabels:
        os: linux
        arch: amd64
    uri: https://github.com/yonahd/kor/releases/download/v0.3.5/kor_Linux_x86_64.tar.gz
    sha256: fe7a9c4a463eea91ba669c2acdcd0e8f31d0afb0274dcc6757f3f064cd764246
    bin: kor
  - selector:
      matchLabels:
        os: linux
        arch: arm64
    uri: https://github.com/yonahd/kor/releases/download/v0.3.5/kor_Linux_arm64.tar.gz
    sha256: fe3c4b391e339ee193876f52b443ec2b7701e3e73c241ab11dc123c72129333a
    bin: kor
  - selector:
      matchLabels:
        os: darwin
        arch: amd64
    uri: https://github.com/yonahd/kor/releases/download/v0.3.5/kor_Darwin_x86_64.tar.gz
    sha256: f72a3c2bf65f711de2214c0ac943d7e0ad2f99ce85204d5fd18ae17479e4329b
    bin: kor
  - selector:
      matchLabels:
        os: darwin
        arch: arm64
    uri: https://github.com/yonahd/kor/releases/download/v0.3.5/kor_Darwin_arm64.tar.gz
    sha256: 95331e60f7facb2b4790ef70805f49d1ec8dbfd7186a13993a2e92460c009cba
    bin: kor
  - selector:
      matchLabels:
        os: windows
        arch: amd64
    uri: https://github.com/yonahd/kor/releases/download/v0.3.5/kor_Windows_x86_64.zip
    sha256: 46e61db6ba2d4c181c09a5a34f6fdeee860b6c9111b8e1f2da39b8ee0111ddcc
    bin: kor.exe

@codecov-commenter
Copy link

codecov-commenter commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.71%. Comparing base (01ef1a3) to head (2a84886).
Report is 2 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
+ Coverage   45.36%   47.71%   +2.35%     
==========================================
  Files          31       31              
  Lines        2665     2741      +76     
==========================================
+ Hits         1209     1308      +99     
+ Misses       1284     1274      -10     
+ Partials      172      159      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yonahd yonahd merged commit 07d6f3e into yonahd:main Mar 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create krew plugin
3 participants