Skip to content

Conversation

superbrothers
Copy link
Member

This PR allows users to use stern as a kubectl plugin.

  • Generate the krew plugin manifest by GoReleaser
  • Update the krew plugin manifest in the krew-index with new version automatically in the release workflow

Note that with this change, the archive files will no longer be wrapped in a directory. Since the krew plugin manifest generated by GoReleaser does not support wrapping in a directory, and the krew-index auto-approval does not work if the directory name contains a version.

Before

$ tar -tf stern_1.20.1_darwin_amd64.tar.gz
stern_1.20.1_darwin_amd64/LICENSE
stern_1.20.1_darwin_amd64/stern

After

$ tar -tf stern_1.20.1-SNAPSHOT-5240615_darwin_amd64.tar.gz
LICENSE
stern

In addition, I manually created a plugin manifest and added it to the krew-index. Therefore stern can already be installed via Krew.

Closes #25

Note that with this change, the archive files will no longer be wrapped
in a directory. Since the krew plugin manifest generated by GoReleaser
does not support wrapping in a directory, and  the krew-index
auto-approval does not work if the directory name contains a version.

**Before**

```
$ tar -tf stern_1.20.1_darwin_amd64.tar.gz
stern_1.20.1_darwin_amd64/LICENSE
stern_1.20.1_darwin_amd64/stern
```

**After**

```
$ tar -tf stern_1.20.1-SNAPSHOT-5240615_darwin_amd64.tar.gz
LICENSE
stern
```
Copy link
Member

@rkmathi rkmathi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!! 😸
I could install stern via krew.

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.

Allow to use stern as a kubectl plugin
2 participants