From fa6442998a124c700009ca940b7c798984519b09 Mon Sep 17 00:00:00 2001 From: Timofei Larkin Date: Fri, 20 Jun 2025 18:19:29 +0300 Subject: [PATCH] Save a list of observed images after workflow Signed-off-by: Timofei Larkin --- .github/workflows/pull-requests.yaml | 9 +++++++++ hack/list-images.sh | 8 ++++++++ packages/core/testing/Makefile | 7 +++++++ 3 files changed, 24 insertions(+) create mode 100644 hack/list-images.sh diff --git a/.github/workflows/pull-requests.yaml b/.github/workflows/pull-requests.yaml index 0e8f786e..9057978a 100644 --- a/.github/workflows/pull-requests.yaml +++ b/.github/workflows/pull-requests.yaml @@ -329,6 +329,15 @@ jobs: - name: Set sandbox ID run: echo "SANDBOX_NAME=cozy-e2e-sandbox-$(echo "${GITHUB_REPOSITORY}:${GITHUB_WORKFLOW}:${GITHUB_REF}" | sha256sum | cut -c1-10)" >> $GITHUB_ENV + - name: List images used + run: make -C packages/core/testing SANDBOX_NAME=$SANDBOX_NAME list-images + + - name: Upload image list + uses: actions/upload-artifact@v4 + with: + name: image-list + path: images.txt + - name: Tear down sandbox run: make -C packages/core/testing SANDBOX_NAME=$SANDBOX_NAME delete diff --git a/hack/list-images.sh b/hack/list-images.sh new file mode 100644 index 00000000..7ae4853a --- /dev/null +++ b/hack/list-images.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +rm ./hosttmp/images.txt + +for node in 11 12 13; do + talosctl -n 192.168.123.${node} -e 192.168.123.${node} images ls >> ./hosttmp/images.txt + talosctl -n 192.168.123.${node} -e 192.168.123.${node} images --namespace system ls >> ./hosttmp/images.txt +done diff --git a/packages/core/testing/Makefile b/packages/core/testing/Makefile index 206ab765..e5101cd2 100755 --- a/packages/core/testing/Makefile +++ b/packages/core/testing/Makefile @@ -62,10 +62,17 @@ exec: ## Opens an interactive shell in the sandbox container. docker exec -ti "${SANDBOX_NAME}" bash apply: delete + mkdir -p /tmp/${SANDBOX_NAME} + chmod 777 /tmp/${SANDBOX_NAME} docker run \ -d --rm --name "${SANDBOX_NAME}" --privileged \ -e TALOSCONFIG=/workspace/talosconfig \ -e KUBECONFIG=/workspace/kubeconfig \ + -e SANDBOX_NAME=${SANDBOX_NAME} \ + -v /tmp/${SANDBOX_NAME}:/workspace/hosttmp \ "$$(yq .e2e.image values.yaml)" \ --timeout 30m docker cp "${ROOT_DIR}" "${SANDBOX_NAME}":/workspace + +list-images: + docker exec "${SANDBOX_NAME}" sh -c 'cd /workspace && hack/list-images.sh'