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 gopass plugin to krew plugin index #208

Merged
merged 5 commits into from
Aug 26, 2019

Conversation

martinhoefling
Copy link
Contributor

PLUGIN DEVELOPERS: @martinhoefling, with some hints from @corneliusweig

Exposes

  • inserting secrets to gopass from a template
  • diffing and applying a single secret stored in gopass
  • recursive diffing and applying secrets

via gopass subcommand.

@k8s-ci-robot
Copy link
Contributor

Welcome @martinhoefling!

It looks like this is your first PR to kubernetes-sigs/krew-index 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/krew-index has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 18, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 18, 2019
@martinhoefling
Copy link
Contributor Author

/assign @juanvallejo

shortDescription: Imports secrets from gopass
homepage: https://github.com/gopasspw/kubectl-gopass
caveats: |
This plugin requires bash and gopass to be set up correctly
Copy link
Member

Choose a reason for hiding this comment

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

“Correctly” is redundant.

caveats: |
This plugin requires bash and gopass to be set up correctly
description: |
This plugin allows applying and diffing secrets from gopass to k8s
Copy link
Member

Choose a reason for hiding this comment

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

Kubernetes is better.

@ahmetb
Copy link
Member

ahmetb commented Aug 18, 2019

/assign

Copy link
Contributor

@corneliusweig corneliusweig left a comment

Choose a reason for hiding this comment

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

Hi, thanks for submitting this to the krew index. This already looks quite good, I only have minor comments.

platforms:
- selector:
matchExpressions:
- {key: os, operator: In, values: [darwin, linux]}
Copy link
Contributor

@corneliusweig corneliusweig Aug 19, 2019

Choose a reason for hiding this comment

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

The script is in pure bash. I think it would also make sense to allow installation on Windows and mention bash as a pre-requisite (which you already do).

Note: for windows, the script should have a .exe ending.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, windows has bash support in newest windows 10 build. I've enabled it. Not sure about the ending though. I will probably revisit later on as gopass support for windows itself is an ongoing topic.

Copy link
Contributor

@corneliusweig corneliusweig Aug 20, 2019

Choose a reason for hiding this comment

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

I'm a bit puzzled now. The manifest has a windows section which also make the CI test fail. Was that intentional?

If you want to add support for windows later, that's fine with me. I was not aware that gopass is not available for windows yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No it shouldn't fail. I made another attempt to fix the build.

metadata:
name: gopass
spec:
version: "v0.0.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a version mismatch between this manifest and what is reported by kubectl gopass version (see https://github.com/gopasspw/kubectl-gopass/blob/59315e46389540624cca8c6ecb45694ed1dc3e87/kubectl-gopass#L140). Have you considered to generate deployment artifacts with a script?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, I added a small helper to create the tags and extracted the version as variable in the script.

- from: "/kubectl-gopass-*/kubectl-gopass"
to: "."
bin: "./kubectl-gopass"
shortDescription: Imports secrets from gopass
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
shortDescription: Imports secrets from gopass
shortDescription: Imports Secrets from gopass

Making it a capital S signals that this is about kubernetes Secret resources. Or maybe even

Imports Secret resources from gopass

homepage: https://github.com/gopasspw/kubectl-gopass
caveats: |
This plugin requires bash and gopass to be set up correctly
description: |
Copy link
Contributor

Choose a reason for hiding this comment

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

Most plugins also give some basic usage instructions and how to get help.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's ok if --help/-h works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can copy / paste the usage output here, but not sure what you will gain. I think the usage is quite obvious for gopass users right?

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 20, 2019
@ahmetb
Copy link
Member

ahmetb commented Aug 20, 2019

Current manifest fails for Windows:

failed to install plugin "gopass": can't create symbolic link, source binary ("/tmp/krew-test665291632/store/gopass/8bae04664693153555af921fb19b896aaccf39f7dec200e430816ff3fa47e1eb/kubectl-gopass.exe") cannot be found in extracted archive: stat /tmp/krew-test665291632/store/gopass/8bae04664693153555af921fb19b896aaccf39f7dec200e430816ff3fa47e1eb/kubectl-gopass.exe: no such file or directory

Copy link
Contributor

@corneliusweig corneliusweig left a comment

Choose a reason for hiding this comment

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

One final thought: do you wish to include a link to gopass, or is that tool so standard nowadays that it's simply not necessary?

@corneliusweig
Copy link
Contributor

/approve
@ahmetb Do you want to take another look, or should I merge?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: corneliusweig, martinhoefling

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:

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 26, 2019
@ahmetb
Copy link
Member

ahmetb commented Aug 26, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 26, 2019
@k8s-ci-robot k8s-ci-robot merged commit 6c3575e into kubernetes-sigs:master Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants