This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch hardened-python-base-images
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit d328cfc0a7d9cd27602cf535c859fe36794dc10c
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Oct 10 22:35:56 2026 +0100

    Count only host keys when waiting for sshd in the CI image
    
    OpenSSH 10 in trixie prints a '# host:port' banner comment per connection 
to ssh-keyscan's stdout, so the line count never matched the three host keys 
and every test job waited until it timed out.
    
    Generated-by: Claude Opus 5
    Claude-Session: https://claude.ai/code/session_014np1fVAxHmGaBFt3qebJ8x
---
 Dockerfile.ci                   | 5 +++--
 scripts/docker/entrypoint_ci.sh | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Dockerfile.ci b/Dockerfile.ci
index 42c8fb507dd..83c20df162b 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -1496,8 +1496,9 @@ SSH_CONFIG
 
         sudo service ssh restart >/dev/null 2>&1
 
-        # Sometimes the server is not quick enough to load the keys!
-        while [[ $(ssh-keyscan -H localhost 2>/dev/null | wc -l) != "3" ]] ; do
+        # Sometimes the server is not quick enough to load the keys! OpenSSH 
10 also prints a
+        # "# localhost:22 SSH-2.0-..." comment line per connection to stdout, 
so count only the keys.
+        while [[ $(ssh-keyscan -H localhost 2>/dev/null | grep -cv '^#') != 
"3" ]] ; do
             echo "Not all keys yet loaded by the server"
             sleep 0.05
         done
diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh
index 856466ad986..1e61d0bd856 100755
--- a/scripts/docker/entrypoint_ci.sh
+++ b/scripts/docker/entrypoint_ci.sh
@@ -200,8 +200,9 @@ SSH_CONFIG
 
         sudo service ssh restart >/dev/null 2>&1
 
-        # Sometimes the server is not quick enough to load the keys!
-        while [[ $(ssh-keyscan -H localhost 2>/dev/null | wc -l) != "3" ]] ; do
+        # Sometimes the server is not quick enough to load the keys! OpenSSH 
10 also prints a
+        # "# localhost:22 SSH-2.0-..." comment line per connection to stdout, 
so count only the keys.
+        while [[ $(ssh-keyscan -H localhost 2>/dev/null | grep -cv '^#') != 
"3" ]] ; do
             echo "Not all keys yet loaded by the server"
             sleep 0.05
         done

Reply via email to