Skip to content

Commit 580460d

Browse files
yuna-tzengJim-0518
andauthored
fix: Extract problematic node location to YAML (GoogleCloudPlatform#1288)
Previously, the `problematic_node_pool_info` utilized a hardcoded suffix (`-c`) to intentionally corrupt the location string for error-path verification. However, this approach could lead to a non-existent location when the configurations in the YAML file changed. This update resolves the issue by removing the hardcoded suffix and defining the complete problematic node location directly within the YAML file. Co-authored-by: Jim Tseng <jim.tseng@cienet.com>
1 parent 3547bcc commit 580460d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

dags/tpu_observability/node_pool_status.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
)
3535
from dags.tpu_observability.utils import node_pool_util as node_pool
3636
from dags.tpu_observability.utils.node_pool_util import NodeOperationSpec
37+
from xlml.apis import gcs
3738

3839
DAG_ID = "gke_node_pool_status"
3940
DAGRUN_TIMEOUT = get_dag_timeout(DAG_ID)
@@ -88,7 +89,13 @@
8889
)
8990

9091
problematic_node_pool_info = copy.deepcopy(node_pool_info)
91-
problematic_node_pool_info.location = f"{node_pool_info.location}-c"
92+
yaml_config = gcs.load_yaml_from_gcs(GCS_CONFIG_PATH)
93+
wrong_node_loc = (
94+
yaml_config.get("dag", {})
95+
.get(DAG_ID, {})
96+
.get("wrong_node_location", "asia-east1-c")
97+
)
98+
problematic_node_pool_info.node_location = wrong_node_loc
9299
problematic_node_pool_info.node_pool_name = (
93100
f"{node_pool_info.node_pool_name}-x"
94101
)

0 commit comments

Comments
 (0)