<p>I am running the command:</p>
<pre><code>kubectl run testbox -it --rm --restart=Never --image=python:buster -- python3
</code></pre>
<p>which will launch a python session and then I input <code>exit()</code> to quit the session. But the session hangs forever there. If I do <code>kubectl get po testbox</code> I can see the pod is already completed.</p>
<p>Then if I hit <code>enter</code> key the console will then output:</p>
<pre><code>E0826 22:43:38.790348 1551782 v2.go:105] EOF
</code></pre>
<p>I noticed that this will not happen if I set <code>--restart=Always</code>. Not sure if it is expected?</p>
<p>Thanks!</p>

<p>There is a similar issue posted on <code>kubectl</code> GtiHub page (<a href="https://github.com/kubernetes/kubectl/issues/1098" rel="nofollow noreferrer">run commands don't return when using kubectl 1.22.x #1098</a>), created 3 days ago. Currently awaiting triage.</p>
<p>This is most probably a bug in <em>1.22</em> version of <code>kubectl</code>. If this issue causes you problems, I suggest downgrading to <em>1.21</em>, as this bug does not occurs in older versions.</p>
