-
Notifications
You must be signed in to change notification settings - Fork 373
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
check all existing index #751
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
|
Welcome @junnplus! |
7d34838
to
cbb6b47
Compare
cbb6b47
to
9152d55
Compare
cmd/krew/cmd/root.go
Outdated
if ok, err := gitutil.IsGitCloned(indexPath); err != nil { | ||
return errors.Wrap(err, "failed to check local index git repository") | ||
} else if !ok { | ||
return errors.New(`krew local plugin index is not initialized (run "kubectl krew update")`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this error message needs to be updated but I'm not exactly sure to what. if we've hit this case that means that there was a non git directory in paths.IndexBase()
. my first instinct is to probably fail if we encounter this since we don't want users manually messing around with their krew folders, krew should take care of that. maybe an error like non git directory found in index folder
? although I think that's somewhat cryptic. another alternative if we don't want to fail would be to just keep track and make sure that there's at least one git repo in there (not exactly sure if that would cause problems elsewhere, not super likely but also not 100% sure).
cc @ahmetb @corneliusweig for your inputs on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we issue a warning to remind users? like "Invalid index directory"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry this fell off my radar.
I think maybe "invalid index found" is ok. My main problem with this is that there's no additional info for the user if they run into this case. Although I think this is most likely ok since if a user runs into this that means they either manually tampered with their krew directory or there's a bug in krew. If its the latter then hopefully an issue would be filed alerting us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chriskim06 Thanks your reply, I updated error message. Please take a look.
Signed-off-by: ye.sijun <junnplus@gmail.com>
9152d55
to
7fbb7bb
Compare
@chriskim06 I'm sorry to bother you, do you have any other thoughts on this PR. cc @ahmetb |
Signed-off-by: ye.sijun <junnplus@gmail.com>
I've manually verified this. It seems to be working fine. I added an extra integration test to ensure this scenario works. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, Junnplus 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 |
Fixes #750.
We shouldn't just check the default index.