Replace flag text with const (#1391)
This commit is contained in:
@@ -32,35 +32,34 @@ type DeleteSubCommand struct {
|
||||
metadata *metav1.ObjectMeta
|
||||
}
|
||||
|
||||
func Delete(flags cli.Input) error {
|
||||
c, err := util.GetServer(flags)
|
||||
func Delete(input cli.Input) error {
|
||||
c, err := util.GetServer(input)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
opts := DeleteSubCommand{
|
||||
client: c,
|
||||
}
|
||||
return opts.do(flags)
|
||||
return opts.do(input)
|
||||
}
|
||||
|
||||
func (opts *DeleteSubCommand) do(flags cli.Input) error {
|
||||
err := opts.complete(flags)
|
||||
func (opts *DeleteSubCommand) do(input cli.Input) error {
|
||||
err := opts.complete(input)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return opts.run(flags)
|
||||
return opts.run(input)
|
||||
}
|
||||
|
||||
func (opts *DeleteSubCommand) complete(flags cli.Input) error {
|
||||
m, err := util.GetMetadata("name", "recorderns", flags)
|
||||
if err != nil {
|
||||
return err
|
||||
func (opts *DeleteSubCommand) complete(input cli.Input) error {
|
||||
opts.metadata = &metav1.ObjectMeta{
|
||||
Name: input.String("name"),
|
||||
Namespace: input.String("recorderns"),
|
||||
}
|
||||
opts.metadata = m
|
||||
return nil
|
||||
}
|
||||
|
||||
func (opts *DeleteSubCommand) run(flags cli.Input) error {
|
||||
func (opts *DeleteSubCommand) run(input cli.Input) error {
|
||||
err := opts.client.RecorderDelete(opts.metadata)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error deleting recorder")
|
||||
|
||||
Reference in New Issue
Block a user