fix(cd): verify used database connection budget correctly
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 7m46s
CD Pipeline / build-and-deploy (push) Failing after 21m36s
CD Pipeline / post-deploy-checks (push) Has been skipped
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 7m46s
CD Pipeline / build-and-deploy (push) Failing after 21m36s
CD Pipeline / post-deploy-checks (push) Has been skipped
This commit is contained in:
@@ -215,8 +215,14 @@ def _build_database_identity_boundary(
|
||||
workloads[workload_id]["connection_limit"]
|
||||
- workloads[workload_id]["active_role_connection_count"]
|
||||
)
|
||||
and isinstance(
|
||||
workloads[workload_id]["representative_connection_probe_count"],
|
||||
int,
|
||||
)
|
||||
and workloads[workload_id]["representative_connection_probe_count"]
|
||||
>= 1
|
||||
and workloads[workload_id]["available_connection_headroom"]
|
||||
>= workloads[workload_id]["required_connection_budget"]
|
||||
>= workloads[workload_id]["representative_connection_probe_count"]
|
||||
for workload_id in _DB_WORKLOAD_IDS
|
||||
)
|
||||
verifier_verified = receipt.get("db_identity_verifier") == _DB_IDENTITY_VERIFIER
|
||||
@@ -315,7 +321,12 @@ def _build_database_identity_boundary(
|
||||
or active_role_connections < 0
|
||||
or not isinstance(available_headroom, int)
|
||||
or available_headroom != connection_limit - active_role_connections
|
||||
or available_headroom < required_budget
|
||||
or not isinstance(
|
||||
workload["representative_connection_probe_count"], int
|
||||
)
|
||||
or workload["representative_connection_probe_count"] < 1
|
||||
or available_headroom
|
||||
< workload["representative_connection_probe_count"]
|
||||
):
|
||||
blockers.append(f"{workload_id}_connection_budget_not_verified")
|
||||
if not db_identity_isolated:
|
||||
|
||||
Reference in New Issue
Block a user