Merge pull request #62848 from deads2k/cli-29-more-record

Automatic merge from submit-queue (batch tested with PRs 62632, 62789, 62512, 62848). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use recordFlags to manage recording

This updates the set commands to use the recordflags and updates the commands we're touching to follow the pattern that is emerging.  A method for New*Options, a valid default value for a recorder there, using the value `o` everywhere to refer to options, naming the struct `<commandName>Options`.

@kubernetes/sig-cli-maintainers 
@soltysh @juanvallejo continues the effort

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2018-04-19 08:58:20 -07:00
committed by GitHub
18 changed files with 318 additions and 237 deletions

View File

@@ -90,6 +90,8 @@ func NewEditOptions(editMode EditMode, out, errOut io.Writer) *EditOptions {
Output: "yaml",
WindowsLineEndings: goruntime.GOOS == "windows",
Recorder: genericclioptions.NoopRecorder{},
Out: out,
ErrOut: errOut,
}
@@ -103,9 +105,9 @@ type editPrinterOptions struct {
// Complete completes all the required options
func (o *EditOptions) Complete(f cmdutil.Factory, args []string, cmd *cobra.Command) error {
o.RecordFlags.Complete(f.Command(cmd, false))
var err error
o.RecordFlags.Complete(f.Command(cmd, false))
o.Recorder, err = o.RecordFlags.ToRecorder()
if err != nil {
return err