add err message if <rsrc>/<name> pairs specified under --local

This commit is contained in:
juanvallejo
2017-07-11 10:19:27 -04:00
parent 6003f87b78
commit c10f4f78bc
6 changed files with 37 additions and 1 deletions

View File

@@ -134,6 +134,13 @@ func (o *SelectorOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
o.builder = o.builder.
ResourceTypeOrNameArgs(o.all, o.resources...).
Latest()
} else {
// if a --local flag was provided, and a resource was specified in the form
// <resource>/<name>, fail immediately as --local cannot query the api server
// for the specified resource.
if len(o.resources) > 0 {
return resource.LocalResourceError
}
}
o.PrintObject = func(obj runtime.Object) error {