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:
@@ -79,6 +79,8 @@ func NewCreateOptions(out, errOut io.Writer) *CreateOptions {
|
||||
PrintFlags: NewPrintFlags("created"),
|
||||
RecordFlags: genericclioptions.NewRecordFlags(),
|
||||
|
||||
Recorder: genericclioptions.NoopRecorder{},
|
||||
|
||||
Out: out,
|
||||
ErrOut: errOut,
|
||||
}
|
||||
@@ -172,9 +174,9 @@ func (o *CreateOptions) ValidateArgs(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
func (o *CreateOptions) Complete(f cmdutil.Factory, 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
|
||||
|
Reference in New Issue
Block a user