Commit 4e29068a authored by Daniel Smith's avatar Daniel Smith

Merge pull request #2468 from hmrm/improve-kubectl-error-message

Improve kubectl "get" error message
parents 0975ab19 bc299031
...@@ -44,7 +44,10 @@ func ResourceFromArgsOrFile(cmd *cobra.Command, args []string, filename string, ...@@ -44,7 +44,10 @@ func ResourceFromArgsOrFile(cmd *cobra.Command, args []string, filename string,
} }
version, kind, err := mapper.VersionAndKindForResource(resource) version, kind, err := mapper.VersionAndKindForResource(resource)
checkErr(err) if err != nil {
// The error returned by mapper is "no resource defined", which is a usage error
usageError(cmd, err.Error())
}
mapping, err = mapper.RESTMapping(version, kind) mapping, err = mapper.RESTMapping(version, kind)
checkErr(err) checkErr(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment