Commit c9dd2a2a authored by Adam Harrison's avatar Adam Harrison

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`.
parent 139a13d3
...@@ -102,6 +102,7 @@ type DeleteOptions struct { ...@@ -102,6 +102,7 @@ type DeleteOptions struct {
DeleteNow bool DeleteNow bool
ForceDeletion bool ForceDeletion bool
WaitForDeletion bool WaitForDeletion bool
Quiet bool
GracePeriod int GracePeriod int
Timeout time.Duration Timeout time.Duration
...@@ -313,7 +314,9 @@ func (o *DeleteOptions) deleteResource(info *resource.Info, deleteOptions *metav ...@@ -313,7 +314,9 @@ func (o *DeleteOptions) deleteResource(info *resource.Info, deleteOptions *metav
return nil, cmdutil.AddSourceToErr("deleting", info.Source, err) return nil, cmdutil.AddSourceToErr("deleting", info.Source, err)
} }
o.PrintObj(info) if !o.Quiet {
o.PrintObj(info)
}
return deleteResponse, nil return deleteResponse, nil
} }
......
...@@ -241,6 +241,7 @@ func (o *RunOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error { ...@@ -241,6 +241,7 @@ func (o *RunOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
deleteOpts.IgnoreNotFound = true deleteOpts.IgnoreNotFound = true
deleteOpts.WaitForDeletion = false deleteOpts.WaitForDeletion = false
deleteOpts.GracePeriod = -1 deleteOpts.GracePeriod = -1
deleteOpts.Quiet = o.Quiet
o.DeleteOptions = deleteOpts o.DeleteOptions = deleteOpts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment