From aa3100ca3418a0dcc001b11544d3e7487b2d6f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mu=C3=9Fler?= Date: Thu, 22 Oct 2020 23:35:43 +0200 Subject: [PATCH] Mount script with tools for easy logaccess and watching objects. --- e2e/exec_into_env.sh | 1 + e2e/run.sh | 1 + e2e/scripts/get_logs.sh | 2 ++ e2e/scripts/watch_objects.sh | 9 +++++++++ 4 files changed, 13 insertions(+) create mode 100755 e2e/scripts/get_logs.sh create mode 100755 e2e/scripts/watch_objects.sh diff --git a/e2e/exec_into_env.sh b/e2e/exec_into_env.sh index ca212c543..ef12ba18a 100755 --- a/e2e/exec_into_env.sh +++ b/e2e/exec_into_env.sh @@ -10,4 +10,5 @@ docker run -it --entrypoint /bin/bash --network=host -e "TERM=xterm-256color" \ --mount type=bind,source="$(readlink -f manifests)",target=/manifests \ --mount type=bind,source="$(readlink -f tests)",target=/tests \ --mount type=bind,source="$(readlink -f exec.sh)",target=/exec.sh \ + --mount type=bind,source="$(readlink -f scripts)",target=/scripts \ -e OPERATOR_IMAGE="${operator_image}" "${e2e_test_runner_image}" diff --git a/e2e/run.sh b/e2e/run.sh index 354b3760e..5bdfdd0a9 100755 --- a/e2e/run.sh +++ b/e2e/run.sh @@ -64,6 +64,7 @@ function run_tests(){ --mount type=bind,source="$(readlink -f manifests)",target=/manifests \ --mount type=bind,source="$(readlink -f tests)",target=/tests \ --mount type=bind,source="$(readlink -f exec.sh)",target=/exec.sh \ + --mount type=bind,source="$(readlink -f scripts)",target=/scripts \ -e OPERATOR_IMAGE="${operator_image}" "${e2e_test_runner_image}" ${E2E_TEST_CASE-} $@ } diff --git a/e2e/scripts/get_logs.sh b/e2e/scripts/get_logs.sh new file mode 100755 index 000000000..1639f3995 --- /dev/null +++ b/e2e/scripts/get_logs.sh @@ -0,0 +1,2 @@ +#!/bin/bash +kubectl logs $(kubectl get pods -l name=postgres-operator --field-selector status.phase=Running -o jsonpath='{.items..metadata.name}') diff --git a/e2e/scripts/watch_objects.sh b/e2e/scripts/watch_objects.sh new file mode 100755 index 000000000..37a68c629 --- /dev/null +++ b/e2e/scripts/watch_objects.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +watch -c " +kubectl get postgresql +echo +kubectl get pods +echo +kubectl get statefulsets +" \ No newline at end of file