From 328055e6e85fafd5622682d8dae27cb752471a80 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 1 Nov 2021 14:03:12 +0100 Subject: [PATCH] DCP: previous_data match should be non-greedy --- lib/runner/strategy/docker_container_pool.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runner/strategy/docker_container_pool.rb b/lib/runner/strategy/docker_container_pool.rb index 491fa701..42c66f66 100644 --- a/lib/runner/strategy/docker_container_pool.rb +++ b/lib/runner/strategy/docker_container_pool.rb @@ -216,7 +216,7 @@ class Runner::Strategy::DockerContainerPool < Runner::Strategy def decode(event_data) case event_data - when /(?.*)((root|python|java|user)@#{@strategy.container_id[0..11]}|#exit|{"cmd": "exit"})/m + when /(?.*?)((root|python|java|user)@#{@strategy.container_id[0..11]}|#exit|{"cmd": "exit"})/m # The RegEx above is used to determine unwanted output which also indicates a program termination. # If the RegEx matches, at least two capture groups will be created. # The first (called `previous_data`) contains any data before the match (including multiple lines)