Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 90de546

Browse files
committed
Fix pod cleanup on exit in k8s connection mode
1 parent 729112c commit 90de546

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

internal/kubernetes/kubernetesPodImpl.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,12 @@ func (k *kubernetesPodImpl) remove(ctx context.Context) error {
274274
k.lock.Lock()
275275
k.shuttingDown = true
276276
k.lock.Unlock()
277-
k.wg.Wait()
277+
// Do not wait to exit in connection mode.
278+
// In session mode this function is called everytime an exec exits in order to ensure all signals/messages have been handled.
279+
// In connection mode this is only called in ssh disconnect, in which case we want to stop all activity
280+
if k.config.Pod.Mode == config2.KubernetesExecutionModeSession {
281+
k.wg.Wait()
282+
}
278283
k.lock.Lock()
279284
k.shutdown = true
280285
k.lock.Unlock()

0 commit comments

Comments
 (0)