Skip to content

Commit 858e07f

Browse files
authored
DPE-4677 Remove parameter not in spec (#463)
* remove foolproof parameter * bump libpatch
1 parent 11ef53e commit 858e07f

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

actions.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ promote-to-primary:
7474
Promotes this cluster to become the primary in the cluster-set. Used for safe switchover or failover.
7575
Can only be run against the charm leader unit of a standby cluster.
7676
params:
77-
cluster-set-name:
78-
type: string
79-
description: |
80-
The name of the cluster-set. Mandatory option, used for confirmation.
8177
force:
8278
type: boolean
8379
default: False

lib/charms/mysql/v0/async_replication.py

+1-5
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

+4-12
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
from pytest_operator.plugin import OpsTest
1616

1717
from .. import juju_
18-
from ..helpers import (
19-
execute_queries_on_unit,
20-
get_cluster_status,
21-
get_leader_unit,
22-
get_relation_data,
23-
)
18+
from ..helpers import execute_queries_on_unit, get_cluster_status, get_leader_unit
2419
from ..markers import juju3
2520
from .high_availability_helpers import DATABASE_NAME, TABLE_NAME
2621

@@ -228,11 +223,10 @@ async def test_standby_promotion(
228223

229224
assert leader_unit is not None, "No leader unit found on standby cluster"
230225

231-
relation_data = await get_relation_data(ops_test, MYSQL_APP1, "database-peers")
232-
cluster_set_name = relation_data[0]["application-data"]["cluster-set-domain-name"]
233226
logger.info("Promoting standby cluster to primary")
234227
await juju_.run_action(
235-
leader_unit, "promote-to-primary", **{"cluster-set-name": cluster_set_name}
228+
leader_unit,
229+
"promote-to-primary",
236230
)
237231

238232
results = await get_max_written_value(first_model, second_model)
@@ -261,12 +255,10 @@ async def test_failover(ops_test: OpsTest, first_model: Model, second_model: Mod
261255
logger.info("Promoting standby cluster to primary with force flag")
262256
leader_unit = await get_leader_unit(None, MYSQL_APP1, first_model)
263257
assert leader_unit is not None, "No leader unit found"
264-
relation_data = await get_relation_data(ops_test, MYSQL_APP1, "database-peers")
265-
cluster_set_name = relation_data[0]["application-data"]["cluster-set-domain-name"]
266258
await juju_.run_action(
267259
leader_unit,
268260
"promote-to-primary",
269-
**{"--wait": "5m", "cluster-set-name": cluster_set_name, "force": True},
261+
**{"--wait": "5m", "force": True},
270262
)
271263

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

0 commit comments

Comments
 (0)