-
Notifications
You must be signed in to change notification settings - Fork 372
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 security notice to be shown after install and upgrade #316
Add security notice to be shown after install and upgrade #316
Conversation
a03d6e1
to
e7d2a07
Compare
Codecov Report
@@ Coverage Diff @@
## master #316 +/- ##
======================================
Coverage 57.3% 57.3%
======================================
Files 19 19
Lines 904 904
======================================
Hits 518 518
Misses 335 335
Partials 51 51 Continue to review full report at Codecov.
|
Do you mind integrating fatih/colors for colors and bold styles? We can iterate on the fine print as well. |
e247905
to
c99da3d
Compare
@ahmetb Sorry for the delay. I think it's a good idea to have colors, however I'd also keep special line markers for terminals without colors. Can you take another look? |
cmd/krew/cmd/install.go
Outdated
@@ -132,7 +134,10 @@ Remarks: | |||
} | |||
fmt.Fprintf(os.Stderr, "Installed plugin: %s\n", plugin.Name) | |||
} | |||
if len(failed) > 0 { | |||
if len(failed)+len(skipped) < len(install) { |
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.
hmm what if we printed it per-plugin?
like, move it up to where we do "Installed plugin: %s"?
@@ -70,6 +76,7 @@ kubectl krew upgrade foo bar"`, | |||
if err != nil { | |||
return errors.Wrapf(err, "failed to upgrade plugin %q", plugin.Name) | |||
} | |||
printSecurityNotice = true | |||
fmt.Fprintf(os.Stderr, "Upgraded plugin: %s\n", plugin.Name) |
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.
ditto here, I think it would be good to print warning per-plugin + right away once it's upgraded.
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.
Yeah, makes sense and simplifies things a little.
Also move the function to an internal package
7c2ffe9
to
812bbc9
Compare
@@ -0,0 +1,31 @@ | |||
// Copyright 2019 The Kubernetes Authors. |
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.
fwiw I think often internal
is not a direct package name. It's usually like internal/abc
where abc is package name. Similarly you don't need to create a new package just for this.
/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 |
Close #315
For example, when running
krew install konfig
, this will print: