(annotationVisitor resource.Visitor)
| 748 | } |
| 749 | |
| 750 | func (o *EditOptions) visitAnnotation(annotationVisitor resource.Visitor) error { |
| 751 | // iterate through all items to apply annotations |
| 752 | err := annotationVisitor.Visit(func(info *resource.Info, incomingErr error) error { |
| 753 | // put configuration annotation in "updates" |
| 754 | if o.ApplyAnnotation { |
| 755 | if err := util.CreateOrUpdateAnnotation(true, info.Object, scheme.DefaultJSONEncoder()); err != nil { |
| 756 | return err |
| 757 | } |
| 758 | } |
| 759 | if err := o.Recorder.Record(info.Object); err != nil { |
| 760 | klog.V(4).Infof("error recording current command: %v", err) |
| 761 | } |
| 762 | |
| 763 | return nil |
| 764 | |
| 765 | }) |
| 766 | return err |
| 767 | } |
| 768 | |
| 769 | // EditMode can be either NormalEditMode, EditBeforeCreateMode or ApplyEditMode |
| 770 | type EditMode string |
no test coverage detected