Skip to content

Commit

Permalink
Code review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskim06 committed Apr 28, 2020
1 parent 9b8752b commit 79cf9e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cmd/krew/cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ Remarks:
Failure to uninstall a plugin will result in an error and exit immediately.`,
RunE: func(cmd *cobra.Command, args []string) error {
for _, name := range args {
if isCanonicalName(name) {
return errors.New("uninstall command does not support INDEX/PLUGIN syntax; just specify PLUGIN")
}
if !validation.IsSafePluginName(name) {
if isCanonicalName(name) {
return errors.New("uninstall command does not support INDEX/PLUGIN syntax; just specify PLUGIN")
}
return unsafePluginNameErr(name)
}
klog.V(4).Infof("Going to uninstall plugin %s\n", name)
Expand Down
8 changes: 4 additions & 4 deletions cmd/krew/cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ kubectl krew upgrade foo bar"`,
} else {
// Upgrade certain plugins
for _, arg := range args {
if isCanonicalName(arg) {
return errors.New("upgrade command does not support INDEX/PLUGIN syntax; just specify PLUGIN")
}
if !validation.IsSafePluginName(arg) {
if isCanonicalName(arg) {
return errors.New("upgrade command does not support INDEX/PLUGIN syntax; just specify PLUGIN")
}
return unsafePluginNameErr(arg)
}
r, err := receipt.Load(paths.PluginInstallReceiptPath(arg))
if err != nil {
return errors.Wrapf(err, "receipt not found for %q", arg)
return errors.Wrapf(err, "read receipt %q", arg)
}
pluginNames = append(pluginNames, r.Status.Source.Name+"/"+r.Name)
}
Expand Down

0 comments on commit 79cf9e1

Please sign in to comment.