|
67 | 67 |
|
68 | 68 | {% for cluster in clusters %}
|
69 | 69 | {% set deploy_cluster = adapter.generate_final_cluster_name(cluster, force_deploy_suffix=True) %}
|
70 |
| - {% if not cluster_exists(cluster) %} |
71 |
| - {{ exceptions.raise_compiler_error("Production cluster " ~ cluster ~ " does not exist") }} |
| 70 | + {% set origin_cluster = adapter.generate_final_cluster_name(cluster, force_deploy_suffix=False) %} |
| 71 | + {% if not cluster_exists(origin_cluster) %} |
| 72 | + {{ exceptions.raise_compiler_error("Production cluster " ~ origin_cluster ~ " does not exist") }} |
72 | 73 | {% endif %}
|
73 | 74 | {% if not cluster_exists(deploy_cluster) %}
|
74 | 75 | {{ exceptions.raise_compiler_error("Deployment cluster " ~ deploy_cluster ~ " does not exist") }}
|
|
91 | 92 |
|
92 | 93 | {% for cluster in clusters %}
|
93 | 94 | {% set deploy_cluster = adapter.generate_final_cluster_name(cluster, force_deploy_suffix=True) %}
|
94 |
| - {{ log("Swapping clusters " ~ adapter.generate_final_cluster_name(cluster) ~ " and " ~ deploy_cluster, info=True) }} |
95 |
| - ALTER CLUSTER {{ adapter.quote(cluster) }} SWAP WITH {{ adapter.quote(deploy_cluster) }}; |
| 95 | + {% set origin_cluster = adapter.generate_final_cluster_name(cluster, force_deploy_suffix=False) %} |
| 96 | + {{ log("Swapping clusters " ~ origin_cluster ~ " and " ~ deploy_cluster, info=True) }} |
| 97 | + ALTER CLUSTER {{ adapter.quote(origin_cluster) }} SWAP WITH {{ adapter.quote(deploy_cluster) }}; |
96 | 98 | {% endfor %}
|
97 | 99 |
|
98 | 100 | COMMIT;
|
|
108 | 110 |
|
109 | 111 | {% for cluster in clusters %}
|
110 | 112 | {% set deploy_cluster = adapter.generate_final_cluster_name(cluster, force_deploy_suffix=True) %}
|
| 113 | + {% set origin_cluster = adapter.generate_final_cluster_name(cluster, force_deploy_suffix=False) %} |
111 | 114 | {{ log("DRY RUN: Swapping clusters " ~ adapter.generate_final_cluster_name(cluster) ~ " and " ~ deploy_cluster, info=True) }}
|
112 |
| - {{ log("DRY RUN: ALTER CLUSTER " ~ adapter.quote(cluster) ~ " SWAP WITH " ~ adapter.quote(deploy_cluster), info=True) }} |
| 115 | + {{ log("DRY RUN: ALTER CLUSTER " ~ adapter.quote(origin_cluster) ~ " SWAP WITH " ~ adapter.quote(deploy_cluster), info=True) }} |
113 | 116 | {% endfor %}
|
114 | 117 | {{ log("Dry run completed. The statements above were **not** executed against Materialize.", info=True) }}
|
115 | 118 | {% endif %}
|
|
0 commit comments