Commit b9536688 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38429 from duglin/removeDelete

Automatic merge from submit-queue (batch tested with PRs 37860, 38429, 38451, 36050, 38463) Remove "pod xxx deleted" message from kubectl run --rm This is a follow-on to https://github.com/kubernetes/kubernetes/issues/28695 Its unnecessary to print the message when the user asked for it. We should only show a msg (error) when we didn't do what they asked. Also showing this in a "kubectl run" is bad because it then gets appended to the user's output and they would then have to strip it off if they want to use the output in some follow-on processing. Signed-off-by: 's avatarDoug Davis <dug@us.ibm.com> ```release-note kubectl run --rm no longer prints "pod xxx deleted" ```
parents 63da5cfe 24fbba39
...@@ -325,7 +325,13 @@ func Run(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *cobr ...@@ -325,7 +325,13 @@ func Run(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *cobr
ResourceNames(mapping.Resource, name). ResourceNames(mapping.Resource, name).
Flatten(). Flatten().
Do() Do()
err = ReapResult(r, f, cmdOut, true, true, 0, -1, false, false, mapper, quiet) // Note: we pass in "true" for the "quiet" parameter because
// ReadResult will only print one thing based on the "quiet"
// flag, and that's the "pod xxx deleted" message. If they
// asked for us to remove the pod (via --rm) then telling them
// its been deleted is unnecessary since that's what they asked
// for. We should only print something if the "rm" fails.
err = ReapResult(r, f, cmdOut, true, true, 0, -1, false, false, mapper, true)
if err != nil { if err != nil {
return err return err
} }
......
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