From 72d4e506d5eae58d5f25f49c239388150ce62574 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 14 Oct 2021 13:00:24 +1100 Subject: [PATCH] intermediate-registry: handle socat warning out Zuul switched to a new base image, and it seems the new socat puts out a warning (something like ... socat[489590] W ioctl(5, IOCTL_VM_SOCKETS_GET_LOCAL_CID, ...): Inappropriate ioctl for device for reference). Grep the output so we only get the line about what port it is listening on. Change-Id: I74fb86a9158b45e6601ee1fbc199ba80cd4991fe --- roles/pull-from-intermediate-registry/tasks/main.yaml | 6 +++++- roles/push-to-intermediate-registry/tasks/push.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/pull-from-intermediate-registry/tasks/main.yaml b/roles/pull-from-intermediate-registry/tasks/main.yaml index 90fadaca8..7958eaacc 100644 --- a/roles/pull-from-intermediate-registry/tasks/main.yaml +++ b/roles/pull-from-intermediate-registry/tasks/main.yaml @@ -9,7 +9,11 @@ # fact that docker does not correctly parse ipv6 addresses. The socat # process will terminate when the playbook ends. - name: Start socat to work around https://github.com/moby/moby/issues/39033 - shell: "socat -d -d TCP-LISTEN:0,fork TCP:{{ buildset_registry.host | ipwrap }}:{{ buildset_registry.port }} 2> {{ zuul.executor.work_root }}/socat_port &" + shell: | + set -o pipefail + socat -d -d TCP-LISTEN:0,fork TCP:{{ buildset_registry.host | ipwrap }}:{{ buildset_registry.port }} 2>&1 | grep --line-buffered 'listening on' > {{ zuul.executor.work_root }}/socat_port & + args: + executable: /bin/bash # Use slurp instead of file lookup to make this testable on a fake # executor node. diff --git a/roles/push-to-intermediate-registry/tasks/push.yaml b/roles/push-to-intermediate-registry/tasks/push.yaml index 347f99d38..57e72da7f 100644 --- a/roles/push-to-intermediate-registry/tasks/push.yaml +++ b/roles/push-to-intermediate-registry/tasks/push.yaml @@ -9,7 +9,11 @@ # fact that docker does not correctly parse ipv6 addresses. The socat # process will terminate when the playbook ends. - name: Start socat to work around https://github.com/moby/moby/issues/39033 - shell: "socat -d -d TCP-LISTEN:0,fork TCP:{{ buildset_registry.host | ipwrap }}:{{ buildset_registry.port }} 2> {{ zuul.executor.work_root }}/socat_port &" + shell: | + set -o pipefail + socat -d -d TCP-LISTEN:0,fork TCP:{{ buildset_registry.host | ipwrap }}:{{ buildset_registry.port }} 2>&1 | grep --line-buffered 'listening on' > {{ zuul.executor.work_root }}/socat_port & + args: + executable: /bin/bash # Use slurp instead of file lookup to make this testable on a fake # executor node.