Skip to content

Commit

Permalink
prevent erroring with empty plugin name (#311)
Browse files Browse the repository at this point in the history
When loading plugin manifest fails, we create an error with
plugin.Name, but plugin instance is an empty struct, so .Name is
empty string.

Signed-off-by: Ahmet Alp Balkan <[email protected]>
  • Loading branch information
ahmetb authored and k8s-ci-robot committed Aug 22, 2019
1 parent 82e6899 commit 29ca49e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/krew/cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ kubectl krew upgrade foo bar"`,
for _, name := range pluginNames {
plugin, err := indexscanner.LoadPluginFileFromFS(paths.IndexPluginsPath(), name)
if err != nil {
return errors.Wrapf(err, "failed to load the index file for plugin %s", plugin.Name)
return errors.Wrapf(err, "failed to load the plugin manifest for plugin %s", name)
}

glog.V(2).Infof("Upgrading plugin: %s\n", plugin.Name)
Expand Down

0 comments on commit 29ca49e

Please sign in to comment.