mirror of https://github.com/k3s-io/k3s
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
parent
139a13d312
commit
c9dd2a2a45
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue