From 29ca49e5a52d2d68792ad24bd7ba5ea3a541920e Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Thu, 22 Aug 2019 01:40:33 -0700 Subject: [PATCH] prevent erroring with empty plugin name (#311) 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 --- cmd/krew/cmd/upgrade.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/krew/cmd/upgrade.go b/cmd/krew/cmd/upgrade.go index d5f2d68b..68edaec8 100644 --- a/cmd/krew/cmd/upgrade.go +++ b/cmd/krew/cmd/upgrade.go @@ -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)