Skip to content

Commit 180cefc

Browse files
authored
remove out-of-spec parameter (#434)
1 parent bdfdfaf commit 180cefc

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

actions.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ promote-to-primary:
7777
Promotes this cluster to become the primary in the cluster-set. Used for safe switchover or failover.
7878
Can only be run against the charm leader unit of a standby cluster.
7979
params:
80-
cluster-set-name:
81-
type: string
82-
description: |
83-
The name of the cluster-set. Mandatory option, used for confirmation.
8480
force:
8581
type: boolean
8682
default: False

lib/charms/mysql/v0/async_replication.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# The unique Charmhub library identifier, never change it
5656
LIBID = "4de21f1a022c4e2c87ac8e672ec16f6a"
5757
LIBAPI = 0
58-
LIBPATCH = 2
58+
LIBPATCH = 3
5959

6060
RELATION_OFFER = "replication-offer"
6161
RELATION_CONSUMER = "replication"
@@ -158,10 +158,6 @@ def _on_promote_to_primary(self, event: ActionEvent) -> None:
158158
event.fail("Only a standby cluster can be promoted")
159159
return
160160

161-
if event.params.get("cluster-set-name") != self.cluster_set_name:
162-
event.fail("Invalid/empty cluster set name")
163-
return
164-
165161
# promote cluster to primary
166162
cluster_name = self.cluster_name
167163
force = event.params.get("force", False)

tests/integration/high_availability/test_async_replication.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
execute_queries_on_unit,
2020
get_cluster_status,
2121
get_leader_unit,
22-
get_relation_data,
2322
get_unit_address,
2423
)
2524
from ..markers import juju3
@@ -237,11 +236,10 @@ async def test_standby_promotion(
237236

238237
assert leader_unit is not None, "No leader unit found on standby cluster"
239238

240-
relation_data = await get_relation_data(ops_test, MYSQL_APP1, "database-peers")
241-
cluster_set_name = relation_data[0]["application-data"]["cluster-set-domain-name"]
242239
logger.info("Promoting standby cluster to primary")
243240
await juju_.run_action(
244-
leader_unit, "promote-to-primary", **{"cluster-set-name": cluster_set_name}
241+
leader_unit,
242+
"promote-to-primary",
245243
)
246244

247245
results = await get_max_written_value(first_model, second_model)
@@ -272,12 +270,10 @@ async def test_failover(ops_test: OpsTest, first_model: Model, second_model: Mod
272270
logger.info("Promoting standby cluster to primary with force flag")
273271
leader_unit = await get_leader_unit(None, MYSQL_APP1, first_model)
274272
assert leader_unit is not None, "No leader unit found"
275-
relation_data = await get_relation_data(ops_test, MYSQL_APP1, "database-peers")
276-
cluster_set_name = relation_data[0]["application-data"]["cluster-set-domain-name"]
277273
await juju_.run_action(
278274
leader_unit,
279275
"promote-to-primary",
280-
**{"--wait": "5m", "cluster-set-name": cluster_set_name, "force": True},
276+
**{"--wait": "5m", "force": True},
281277
)
282278

283279
cluster_set_status = await get_cluster_status(leader_unit, cluster_set=True)

0 commit comments

Comments
 (0)