mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
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`.
This commit is contained in:
parent
139a13d312
commit
c9dd2a2a45
@ -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
|
|||||||
return nil, cmdutil.AddSourceToErr("deleting", info.Source, err)
|
return nil, cmdutil.AddSourceToErr("deleting", info.Source, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !o.Quiet {
|
||||||
o.PrintObj(info)
|
o.PrintObj(info)
|
||||||
|
}
|
||||||
return deleteResponse, nil
|
return deleteResponse, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user