diff --git a/entrypoint.sh b/entrypoint.sh index 23b0ab5..bc680fa 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -65,10 +65,10 @@ ci_k8s_request() { # ci_k8s_request : start a CI k8s run of this # that already has that region's label asks for a start too (see the needs_sandbox branch). # Never fails the action. # -# A regional label (`sandbox :australia:` from needs_sandbox:ap) passes its region, the +# A regional label (`sandbox :australia:` from needs_sandbox:ap) starts in its region, the # needs_sandbox suffix (eu, ca, gov, uae, wu, ap). Which regions have a CI k8s sandbox is # sandbox.yml's own list (its region input's options): it rejects any other (HTTP 422), -# which leaves the fleet's sandbox alone. +# which leaves the fleet's sandbox alone. stop_sandbox stops in every region at once (`all`). sandbox_k8s_request() { # sandbox_k8s_request [region]: start or stop this PR's CI k8s sandbox [[ "${SANDBOX_K8S_TRIGGER:-false}" == "true" ]] || return 0 local region="${2:-}" inputs ref @@ -376,32 +376,25 @@ if [[ $comment_body == "stop_sandbox" ]]; then case $label in sandbox) remove_label "sandbox" - sandbox_k8s_request stop ;; "sandbox :eu:") remove_label "sandbox%20:eu:" - sandbox_k8s_request stop eu ;; "sandbox :maple_leaf:") remove_label "sandbox%20:maple_leaf:" - sandbox_k8s_request stop ca ;; "sandbox :classical_building:") remove_label "sandbox%20:classical_building:" - sandbox_k8s_request stop gov ;; "sandbox :united_arab_emirates:") - remove_label "sandbox%20:united_arab_emirates:" - sandbox_k8s_request stop uae - ;; + remove_label "sandbox%20:united_arab_emirates:" + ;; "sandbox :us:") - remove_label "sandbox%20:us:" - sandbox_k8s_request stop wu - ;; + remove_label "sandbox%20:us:" + ;; "sandbox :australia:") - remove_label "sandbox%20:australia:" - sandbox_k8s_request stop ap - ;; + remove_label "sandbox%20:australia:" + ;; sandbox:${alternate_python_version}) remove_label "sandbox:${alternate_python_version}" ;; @@ -428,4 +421,9 @@ if [[ $comment_body == "stop_sandbox" ]]; then ;; esac done + # The CI k8s sandbox is stopped in every region (sandbox.yml's region `all`), whatever labels + # were found above: a sandbox can be running with its label gone (removed by hand after its + # start was asked for), and those labels are the PR's when this run was created, not when the + # comment was posted. A region with nothing running is left as it is. + sandbox_k8s_request stop all fi