Save a list of observed images after workflow

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
This commit is contained in:
Timofei Larkin
2025-06-20 18:19:29 +03:00
committed by Andrei Kvapil
parent 7f9f850b47
commit fa6442998a
3 changed files with 24 additions and 0 deletions

View File

@@ -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

8
hack/list-images.sh Normal file
View File

@@ -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

View File

@@ -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'