Make a change to visitor to allow it to accept an error, like Go's path walker

This commit is contained in:
feihujiang
2015-06-15 10:48:56 +08:00
parent b5a4a548df
commit 29dc7f6ec2
12 changed files with 128 additions and 101 deletions

View File

@@ -199,7 +199,10 @@ func RunLabel(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
}
// TODO: support bulk generic output a la Get
return r.Visit(func(info *resource.Info) error {
return r.Visit(func(info *resource.Info, err error) error {
if err != nil {
return err
}
obj, err := cmdutil.UpdateObject(info, func(obj runtime.Object) error {
err := labelFunc(obj, overwrite, resourceVersion, labels, remove)
if err != nil {