Skip to content

Commit

Permalink
Fix pod cleanup on exit in k8s connection mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tsipinakis committed Jan 6, 2024
1 parent 729112c commit 90de546
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/kubernetes/kubernetesPodImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ func (k *kubernetesPodImpl) remove(ctx context.Context) error {
k.lock.Lock()
k.shuttingDown = true
k.lock.Unlock()
k.wg.Wait()
// Do not wait to exit in connection mode.
// In session mode this function is called everytime an exec exits in order to ensure all signals/messages have been handled.
// In connection mode this is only called in ssh disconnect, in which case we want to stop all activity
if k.config.Pod.Mode == config2.KubernetesExecutionModeSession {
k.wg.Wait()
}
k.lock.Lock()
k.shutdown = true
k.lock.Unlock()
Expand Down

0 comments on commit 90de546

Please sign in to comment.