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

Add script for generating a krew plugin manifest. #645

Merged
merged 6 commits into from
Jul 31, 2019

Conversation

jbarrick-mesosphere
Copy link
Member

@jbarrick-mesosphere jbarrick-mesosphere commented Jul 24, 2019

What type of PR is this?

/kind enhancement

What this PR does / why we need it:

This adds a script that can generate a krew plugin manifest from the output of goreleaser. I don't know if there's a way to run this with goreleaser, but if there is we should do that.

Which issue(s) this PR fixes:

Fixes #276

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@jbarrick-mesosphere
Copy link
Member Author

jbarrick-mesosphere commented Jul 25, 2019

Would we rather generate this manifest from disk or have it fetch the archives from Github and SHA them from there?

I've changed it to fetch the archives from Github for hashing. Now you can generate this for any release without needing to build it first.

➜  kudo git:(krew) ✗ VERSION=0.3.2 hack/generate_krew.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   621    0   621    0     0   1673      0 --:--:-- --:--:-- --:--:--  1673
100 11.0M  100 11.0M    0     0  4114k      0  0:00:02  0:00:02 --:--:-- 5241k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   619    0   619    0     0   1940      0 --:--:-- --:--:-- --:--:--  1940
100 10.5M  100 10.5M    0     0  3629k      0  0:00:02  0:00:02 --:--:-- 5183k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   622    0   622    0     0   2080      0 --:--:-- --:--:-- --:--:--  2080
100 11.5M  100 11.5M    0     0  4204k      0  0:00:02  0:00:02 --:--:-- 5926k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   620    0   620    0     0   1802      0 --:--:-- --:--:-- --:--:--  1802
100 11.0M  100 11.0M    0     0  4047k      0  0:00:02  0:00:02 --:--:-- 6107k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   623    0   623    0     0   1455      0 --:--:-- --:--:-- --:--:--  1452
100 11.0M  100 11.0M    0     0  3685k      0  0:00:03  0:00:03 --:--:-- 5713k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   621    0   621    0     0   1821      0 --:--:-- --:--:-- --:--:--  1821
100 10.4M  100 10.4M    0     0  4187k      0  0:00:02  0:00:02 --:--:-- 6826k
To publish to the krew index, create a pull request to https://github.com/kubernetes-sigs/krew-index/tree/master/plugins to update kudo.yaml with the newly generated kudo.yaml.
➜  kudo git:(krew) ✗ kubectl krew install --manifest=kudo.yaml
Installing plugin: kudo
Installed plugin: kudo
➜  kudo git:(krew) ✗ kubectl kudo version
KUDO Version: version.Info{GitVersion:"0.3.2", GitCommit:"81cbddc1", BuildDate:"2019-07-12T19:23:42Z", GoVersion:"go1.12.4", Compiler:"gc", Platform:"linux/amd64"}
➜  kudo git:(krew) ✗ 

Copy link
Contributor

@alenkacz alenkacz left a comment

Choose a reason for hiding this comment

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

I guess it looks good :) but please adjust the release documentation - Release.MD to contain information about how to run this and when to run this

@jbarrick-mesosphere
Copy link
Member Author

The Krew project has not yet defined acceptance criteria for plugins. So I've done some digging to see how we can maximize our chances.

Here's an example of a plugin that did poorly in review: kubernetes-sigs/krew-index#146

Hey, I think conftest is a great tool and it deserves to be featured so that k8s users get aware of it. However, I'm a bit worried that it requires so many extra speps to be useful. As far as I understand, you need to have a policy folder with rego rules. This means that interested users need to dig deep into the conftest manual before they can get started. Your suggested starting point is to clone an example rules repo. At that point, a user might as well also download conftest and I don't see the advantage to invoke conftest via kubectl.
Further, my feeling is that conftest is by spirit not an extension of kubectl, but rather a standalone k8s tool. We haven't defined yet, what are the criteria for a krew plugin, but looking at what we have, I would say: tools that extend existing kubectl functionality. Only very few require extra configuration. And in that regard, I don't see how conftest fits in. To me it looks more like a tool from the k8s kosmos, but very different from kubectl.

They also started a document describing criteria that might be helpful: kubernetes-sigs/krew-index#152

In light of this, I think we should spend some time refining the description and short description to be more clear on what KUDO does and why you would install the CLI.

@jbarrick-mesosphere jbarrick-mesosphere added this to the 0.5.0 milestone Jul 26, 2019
@kudo-ci
Copy link

kudo-ci commented Jul 30, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alenkacz, jbarrick-mesosphere, kensipe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [alenkacz,jbarrick-mesosphere,kensipe]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

spec:
version: "${VERSION}"

shortDescription: Declaratively build, install, and run operators using KUDO.
Copy link
Member Author

Choose a reason for hiding this comment

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

@mattj-io / @yankcrime / @gerred / @runyontr is there someone that would be willing to help me edit the descriptions here?

@jbarrick-mesosphere
Copy link
Member Author

/cc @runyontr @mattj-io @yankcrime

@kudo-ci kudo-ci requested a review from runyontr July 30, 2019 17:50
@kudo-ci
Copy link

kudo-ci commented Jul 30, 2019

@jbarrick-mesosphere: GitHub didn't allow me to request PR reviews from the following users: mattj-io.

Note that only kudobuilder members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @runyontr @mattj-io @yankcrime

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kudo-ci kudo-ci requested a review from yankcrime July 30, 2019 17:50
@jbarrick-mesosphere jbarrick-mesosphere merged commit b7840d2 into kudobuilder:master Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include KUDO CLI in homebrew core repo and krew
4 participants