kubectl run --quiet suppresses deletion messages

The `--quiet` option should prevent kubectl run from polluting the
output from an attached container - make it apply to the resource
deletion messages caused by `--rm`.
pull/564/head
Adam Harrison 2019-01-24 11:48:17 +00:00
parent 139a13d312
commit c9dd2a2a45
2 changed files with 5 additions and 1 deletions

View File

@ -102,6 +102,7 @@ type DeleteOptions struct {
DeleteNow bool
ForceDeletion bool
WaitForDeletion bool
Quiet bool
GracePeriod int
Timeout time.Duration
@ -313,7 +314,9 @@ func (o *DeleteOptions) deleteResource(info *resource.Info, deleteOptions *metav
return nil, cmdutil.AddSourceToErr("deleting", info.Source, err)
}
o.PrintObj(info)
if !o.Quiet {
o.PrintObj(info)
}
return deleteResponse, nil
}

View File

@ -241,6 +241,7 @@ func (o *RunOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
deleteOpts.IgnoreNotFound = true
deleteOpts.WaitForDeletion = false
deleteOpts.GracePeriod = -1
deleteOpts.Quiet = o.Quiet
o.DeleteOptions = deleteOpts