File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion: kuttl.dev/v1beta1
3+ kind: TestAssert
4+ metadata:
5+ name: test-log-endpoint
6+ timeout: 240
7+ commands:
8+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9+ - script: |
10+ set -eu
11+
12+ # Log-Endpoint Test:
13+ # This is executed from the Webserver as JWT keys must be present.
14+ # A small server is started on each worker that serves the logs on its
15+ # 8793 port for the Webserver: we don't use the token as that is an
16+ # internal implementation, but check that the end-point is reachable,
17+ # indicated by a 403.
18+ CURL_RESPONSE=$(
19+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20+ )
21+
22+ # Log-Endpoint Test Assertion:
23+ echo "The HTTP Code should be 403 to indicate the log server is reachable (the internal JWT token is needed for full access): $CURL_RESPONSE" | grep 403
24+ {% endif %}
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion: kuttl.dev/v1beta1
3+ kind: TestAssert
4+ metadata:
5+ name: test-log-endpoint
6+ timeout: 240
7+ commands:
8+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9+ - script: |
10+ set -eu
11+
12+ # Log-Endpoint Test:
13+ # This is executed from the Webserver as JWT keys must be present.
14+ # A small server is started on each worker that serves the logs on its
15+ # 8793 port for the Webserver: we don't use the token as that is an
16+ # internal implementation, but check that the end-point is reachable,
17+ # indicated by a 403.
18+ CURL_RESPONSE=$(
19+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20+ )
21+
22+ # Log-Endpoint Test Assertion:
23+ echo "The HTTP Code should be 403 to indicate the log server is reachable (the internal JWT token is needed for full access): $CURL_RESPONSE" | grep 403
24+ {% endif %}
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion: kuttl.dev/v1beta1
3+ kind: TestAssert
4+ metadata:
5+ name: test-log-endpoint
6+ timeout: 240
7+ commands:
8+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9+ - script: |
10+ set -eu
11+
12+ # Log-Endpoint Test:
13+ # This is executed from the Webserver as JWT keys must be present.
14+ # A small server is started on each worker that serves the logs on its
15+ # 8793 port for the Webserver: we don't use the token as that is an
16+ # internal implementation, but check that the end-point is reachable,
17+ # indicated by a 403.
18+ # Rolegroup custom-log-config
19+ CURL_RESPONSE=$(
20+ kubectl -n $NAMESPACE exec airflow-webserver-custom-log-config-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-custom-log-config-headless:8793 2>/dev/null || true);echo "$CODE"'
21+ )
22+
23+ # Log-Endpoint Test Assertions:
24+ echo "The HTTP Code should be 403 to indicate the log server is reachable (the internal JWT token is needed for full access): $CURL_RESPONSE" | grep 403
25+
26+ # Rolegroup automatic-log-config
27+ CURL_RESPONSE=$(
28+ kubectl -n $NAMESPACE exec airflow-webserver-automatic-log-config-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-automatic-log-config-headless:8793 2>/dev/null || true);echo "$CODE"'
29+ )
30+ echo "The HTTP Code should be 403 to indicate the log server is reachable (the internal JWT token is needed for full access): $CURL_RESPONSE" | grep 403
31+ {% endif %}
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion: kuttl.dev/v1beta1
3+ kind: TestAssert
4+ metadata:
5+ name: test-log-endpoint
6+ timeout: 240
7+ commands:
8+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9+ - script: |
10+ set -eu
11+
12+ # Log-Endpoint Test:
13+ # This is executed from the Webserver as JWT keys must be present.
14+ # A small server is started on each worker that serves the logs on its
15+ # 8793 port for the Webserver: we don't use the token as that is an
16+ # internal implementation, but check that the end-point is reachable,
17+ # indicated by a 403.
18+ CURL_RESPONSE=$(
19+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20+ )
21+
22+ # Log-Endpoint Test Assertion:
23+ echo "The HTTP Code should be 403 to indicate the log server is reachable (the internal JWT token is needed for full access): $CURL_RESPONSE" | grep 403
24+ {% endif %}
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion: kuttl.dev/v1beta1
3+ kind: TestAssert
4+ metadata:
5+ name: test-log-endpoint
6+ timeout: 240
7+ commands:
8+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9+ - script: |
10+ set -eu
11+
12+ # Log-Endpoint Test:
13+ # This is executed from the Webserver as JWT keys must be present.
14+ # A small server is started on each worker that serves the logs on its
15+ # 8793 port for the Webserver: we don't use the token as that is an
16+ # internal implementation, but check that the end-point is reachable,
17+ # indicated by a 403.
18+ CURL_RESPONSE=$(
19+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20+ )
21+
22+ # Log-Endpoint Test Assertion:
23+ echo "The HTTP Code should be 403 to indicate the log server is reachable (the internal JWT token is needed for full access): $CURL_RESPONSE" | grep 403
24+ {% endif %}
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion: kuttl.dev/v1beta1
3+ kind: TestAssert
4+ metadata:
5+ name: test-log-endpoint
6+ timeout: 240
7+ commands:
8+ {% if test_scenario ['values' ]['executor' ] == 'celery' %}
9+ - script: |
10+ set -eu
11+
12+ # Log-Endpoint Test:
13+ # This is executed from the Webserver as JWT keys must be present.
14+ # A small server is started on each worker that serves the logs on its
15+ # 8793 port for the Webserver: we don't use the token as that is an
16+ # internal implementation, but check that the end-point is reachable,
17+ # indicated by a 403.
18+ CURL_RESPONSE=$(
19+ kubectl -n $NAMESPACE exec airflow-webserver-default-0 -- sh -c 'CODE=$(curl -s -o /dev/null -w "%{http_code}" http://airflow-worker-default-headless:8793 2>/dev/null || true);echo "$CODE"'
20+ )
21+
22+ # Log-Endpoint Test Assertion:
23+ echo "The HTTP Code should be 403 to indicate the log server is reachable (the internal JWT token is needed for full access): $CURL_RESPONSE" | grep 403
24+ {% endif %}
You can’t perform that action at this time.
0 commit comments