Skip to content

Commit f1068f2

Browse files
committed
Fix tests
1 parent 4323001 commit f1068f2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/deployment-cli-tools/ch_cli_tools/skaffold.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ def process_build_dockerfile(dockerfile_path, root_path, global_context=False, r
143143
def identify_unicorn_based_main(candidates):
144144
import re
145145
gunicorn_pattern = re.compile(r"gunicorn")
146-
for candidate in candidates:
146+
# sort candidates, shortest path first
147+
for candidate in sorted(candidates,key=lambda x: len(x.split("/"))):
147148
dockerfile_path = f"{candidate}/.."
148149
while not exists(f"{dockerfile_path}/Dockerfile") and abspath(dockerfile_path) != abspath(root_path):
149150
dockerfile_path += "/.."

0 commit comments

Comments
 (0)