diff --git a/scaletest/templates/scaletest-runner/scripts/lib.sh b/scaletest/templates/scaletest-runner/scripts/lib.sh index 884e0a3b91eff..f70b92fcdd6b1 100644 --- a/scaletest/templates/scaletest-runner/scripts/lib.sh +++ b/scaletest/templates/scaletest-runner/scripts/lib.sh @@ -40,7 +40,7 @@ show_json() { set_status() { dry_run= if [[ ${DRY_RUN} == 1 ]]; then - dry_run=" (dry-ryn)" + dry_run=" (dry-run)" fi prev_status=$(get_status) if [[ ${prev_status} != *"Not started"* ]]; then @@ -49,6 +49,9 @@ set_status() { echo "$(date -Ins) ${*}${dry_run}" >>"${SCALETEST_STATE_DIR}/status" annotate_grafana "status" "Status: ${*}" + + status_lower=$(tr '[:upper:]' '[:lower:]' <<<"${*}") + set_pod_status_annotation "${status_lower}" } lock_status() { chmod 0440 "${SCALETEST_STATE_DIR}/status" @@ -247,6 +250,16 @@ set_appearance() { "${CODER_URL}/api/v2/appearance" } +namespace() { + cat /var/run/secrets/kubernetes.io/serviceaccount/namespace +} +coder_pods() { + kubectl get pods \ + --namespace "$(namespace)" \ + --selector "app.kubernetes.io/name=coder,app.kubernetes.io/part-of=coder" \ + --output jsonpath='{.items[*].metadata.name}' +} + # fetch_coder_full fetches the full (non-slim) coder binary from one of the coder pods # running in the same namespace as the current pod. fetch_coder_full() { @@ -254,26 +267,26 @@ fetch_coder_full() { log "Full Coder binary already exists at ${SCALETEST_CODER_BINARY}" return fi - local pod - local namespace - namespace=$(