-
Notifications
You must be signed in to change notification settings - Fork 363
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 --no-update-index option to bypass updates #279
Add --no-update-index option to bypass updates #279
Conversation
Codecov Report
@@ Coverage Diff @@
## master #279 +/- ##
==========================================
+ Coverage 55.07% 55.34% +0.26%
==========================================
Files 19 19
Lines 877 880 +3
==========================================
+ Hits 483 487 +4
+ Misses 341 337 -4
- Partials 53 56 +3
Continue to review full report at Codecov.
|
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.
One nit, otherwise looks good.
glog.V(4).Infof("--manifest specified, not ensuring plugin index") | ||
return nil | ||
if *noUpdateIndex { | ||
glog.V(4).Infof("--no-update-index specified, skipping updating local copy of plugin index") |
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.
This is missing a return nil
here.
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.
Good catch! Fixed.
This option added to 'install' and 'upgrade' sub-commands allows users (primarily developers) to test behavior locally (such as upgrades) while preventing krew from auto-{updating,reverting,resetting} changes to the local copy of the index repository at $KREW_ROOT/index. Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
14a56a4
to
88fec4a
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, corneliusweig 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 |
This option added to 'install' and 'upgrade' sub-commands allows users
(primarily developers) to test behavior locally (such as upgrades) while
preventing krew from auto-{updating,reverting,resetting} changes to the
local copy of the index repository at $KREW_ROOT/index.
Introducing this flag as "experimental", this way we can delete it if we don't
like it in the future. It's provided as an "escape hatch". An alternative I
can think of is a file like
$dir/.noupdate
existing in the index repo, butI think this is cleaner.
Two issues that are in my mind currently wrt this change:
I can't recide between
--no-update-index
vs--no-index-update
. In ourgcloud
conventions we tend to use--no-$VERB-$NOUN
so I'm going withthis.
Writing integration tests currently sound unnecessary to me, although it's
probably possible (we can write files to the per-test index dir, and see if
they survive krew upgrade and krew install, which don't have to succeed).
Thoughts?
Fixes #263.