derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
26.91k stars 1.69k forks source link

Support winget #1697

Closed vdurante closed 1 year ago

vdurante commented 2 years ago




Is your feature request related to a problem? Please describe. No

Describe the solution you'd like k9s to be published to winget

Describe alternatives you've considered none, we already have choco and scoop, which are great. But would be cool to have k9s as part of winget as well, specially since it is officially supported by Microsoft

Additional context

iSeiryu commented 2 years ago

+1 I wanted to avoid installing scoop and/or choco on my work machine. winget is here out of the box.

slimus commented 2 years ago

Hi @vdurante! I'm not sure, but I guess you can create installer file and create PR in winget repo: https://learn.microsoft.com/en-us/windows/package-manager/package/manifest?tabs=minschema%2Cversion-example Just use right versions and arch from the release page: https://github.com/derailed/k9s/releases

iSeiryu commented 1 year ago

How would it get updates if he submits a single release to their repo? It feels like it should be a part of the build pipeline.

slimus commented 1 year ago

@iSeiryu we can't automate it because we don't have tooling yet.

Meir017 commented 1 year ago

@slimus I think it looks like we do have the tooling now

mloskot commented 1 year ago

Here is an example of fairly generic GHA workflow to submit winget manifest on release https://github.com/microsoft/PowerToys/blob/main/.github/workflows/package-submissions.yml

slimus commented 1 year ago

What do you think about https://github.com/microsoft/winget-pkgs/pull/109013/files? @derailed please review my MR, to make sure I used the correct name, description, license, etc. Thanks!

slimus commented 1 year ago

@Meir017 @mloskot @vdurante @iSeiryu please try to install it with winget install k9s. Let me know if you find any issues. Thanks!

slimus commented 1 year ago

https://github.com/derailed/k9s/pull/2117

mloskot commented 1 year ago

@slimus Awesome, thanks! No issues for me

image

and after the installation, it starts fine in the very same Command Prompt

image

It also works for me in the Git Bash console.

slimus commented 1 year ago

@mloskot it looks like on the second screenshot you run different version of k9s. I added 0.27.4, but you have 0.27.3... Please check your paths and find old instance. Thanks for testing it!

mloskot commented 1 year ago

@slimus Good catch! It was K9s installed with Chocolatey, which I've now removed:

image

felpel commented 1 year ago

@slimus any clue on why this would happen? I uninstalled k9s that was originally managed by scoop before I ran the winget install command:

winget install k9s

Found k9s [Derailed.k9s] Version 0.27.4
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
An unexpected error occurred while executing the command:
0x80070032 : The request is not supported.
slimus commented 1 year ago

@felpel can you show me your winget version (winget info), please? And try to upgrade winget after it and install k9s again.

mloskot commented 1 year ago

@felpel To what @slimus suggested, check if you have any pending upgrades of App Installer via Microsoft Store The error looks like an old winget indeed, see at the bottom of https://devblogs.microsoft.com/commandline/windows-package-manager-1-3/

felpel commented 1 year ago

Upgrading winget itself fixed it, thank you ❤️

Meir017 commented 1 year ago

Worked for me too! image (I just had to open a new shell for reloading the env-var)

mloskot commented 1 year ago

@Meir017 Yeah, it looks like it was the first time winget added your $env:USERPROFILE\AppData\Local\Microsoft\WinGet\Links to PATH. The yellow message "Command line alias added" indicates executable was (hard or sym)link-ed in that Links folder. The winget tries to avoid polluting your PATH with numerous entries, trying to put exeutable aliases in Links as common location. The \Links features is a reason to run winget as Administrator - see this for details https://github.com/microsoft/winget-pkgs/issues/99059#issuecomment-1462894923

felpel commented 1 year ago

Before we close this issue, I would suggest to update the Installation section in the README 😄

mloskot commented 1 year ago

@felpel #2117

slimus commented 1 year ago

@mloskot thanks! Yes, I already created PR for it :)

sprat commented 10 months ago

I just noticed that the new version 0.29.x in not available via winget yet.

I understand that there's no automation yet to publish packages automatically, but is there an issue tracking that in this repo?

Also, in the mean time, what is/should be the process to have new versions available? Should we send pull requests to the winget repo? is there someone in charge of that when new release are out?

mloskot commented 10 months ago

@sprat I have submitted new winget manifest for the latest 0.29.1

what is/should be the process to have new versions available?

From winget-pkgs repo perspective, the submission procedure is well documented.

Should we send pull requests to the winget repo?

Yes, and everyone can submit new/updated package manifests to winget-pkgs repo.


FYI, here is how to use https://github.com/microsoft/winget-create to quickly contribute the manifest update to the winget-pkgs upstream - this is how I run it in PowerShell on Windows 11

$ gh repo clone microsoft/winget-pkgs
$ cd microsoft/winget-pkgs
$ wingetcreate update --version 0.29.1 Derailed.k9s

Next, launch Command Prompt as Administrator to validate and test the local manifest - Administrator only needed for smooth mklink-aliasing of the executable, see the yellow status message:

289068907-9e424f7f-cae4-4c73-97e6-653c7aa35e00

Finally, submit it via pull request - new local branch will be created automatically:

$ wingetcreate submit .\manifests\d\Derailed\k9s\0.29.1

image

sprat commented 10 months ago

Ok thanks for everything!

mloskot commented 10 months ago

My PR has now been merged, so K9s 0.29.1 should now been installable with winger

fdohrendorfG commented 1 month ago

This is awesome, thanks!

Note: The website does not list this option yet.