Reset crawl state to running when any crawlers are running (after post-process states) (#1179)

* operator state changes: (fixes #1178)
- if at least one crawler is 'running' ensure state is reset back to running
- for multiple instances, set status to earliest state (not latest) to be consistent,
eg. if at least one crawl is running, set to running, if at least one is generating wacz, set to that
This commit is contained in:
Ilya Kreymer 2023-09-15 09:16:46 -07:00 committed by GitHub
parent 2efc461b9b
commit ff327c0b8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -822,10 +822,14 @@ class BtrixOperator(K8sAPI):
# check for other statuses
else:
new_status = None
if status_count.get("uploading-wacz"):
new_status = "uploading-wacz"
if status_count.get("running"):
if status.state in ("generate-wacz", "uploading-wacz", "pending-wacz"):
new_status = "running"
elif status_count.get("generate-wacz"):
new_status = "generate-wacz"
elif status_count.get("uploading-wacz"):
new_status = "uploading-wacz"
elif status_count.get("pending-wait"):
new_status = "pending-wait"
if new_status: