Skip to content

Commit 2d882ed

Browse files
authored
[DPE-8877] Upgrade MySQL to 8.0.44 (#76)
* Upgrade K8s router operator to 8.0.44 * Upgrade machine router operator to 8.0.44 * Bump workload version * Add more visible guidance on README * Make test_upgrade.py to pass * Remove outdated workaround * Revert "Make test_upgrade.py to pass" This reverts commit 1f3e615. * Fix charm refresh in test_upgrade * Clarify charm key in refresh_versions.toml
1 parent 0e8abaf commit 2d882ed

File tree

6 files changed

+20
-17
lines changed

6 files changed

+20
-17
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ Relations are defined in `metadata.yaml` are:
4949

5050
## Contributing
5151

52+
To build the charms:
53+
54+
```
55+
cd kubernetes && charmcraftlocal pack
56+
cd machines && charmcraftlocal pack
57+
```
58+
5259
Please see the [Juju SDK docs](https://juju.is/docs/sdk) for guidelines on
5360
enhancements to this charm following best practice guidelines, and
5461
[CONTRIBUTING.md](./CONTRIBUTING.md)
55-
for developer guidance.
62+
for further developer guidance.

common/common/workload.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,6 @@ def _get_bootstrap_command(
272272
"--conf-use-gr-notifications",
273273
"--conf-set-option",
274274
"metadata_cache:bootstrap.ttl=5",
275-
# destination_status added to workaround MySQL Router bug
276-
# https://bugs.mysql.com/bug.php?id=118059
277-
# TODO: Remove once fixed on upstream
278-
"--conf-set-option",
279-
"destination_status.error_quarantine_threshold=3",
280-
"--conf-set-option",
281-
"destination_status.error_quarantine_interval=5",
282275
]
283276

284277
def _bootstrap_router(self, *, event, tls: bool) -> None:

kubernetes/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ resources:
5959
mysql-router-image:
6060
type: oci-image
6161
description: OCI image for mysql-router
62-
upstream-source: ghcr.io/canonical/charmed-mysql@sha256:e78bdba30923ec87d67879a284d9162dfbb7600b34cbf3f84c9b4cce08648715
62+
upstream-source: ghcr.io/canonical/charmed-mysql@sha256:672f20830d66678a3ece7285048700d6e52a9393202eb51e9749eb35031559c4
6363
assumes:
6464
- k8s-api

kubernetes/refresh_versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# https://canonical-charm-refresh.readthedocs-hosted.com/latest/refresh-versions-toml/
22

33
charm_major = 1
4-
workload = "8.0.42"
4+
workload = "8.0.44"

kubernetes/tests/integration/test_upgrade.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
APPLICATION_APP_NAME = APPLICATION_DEFAULT_APP_NAME
3737

3838
METADATA = yaml.safe_load(Path("./metadata.yaml").read_text())
39+
RESOURCES = {"mysql-router-image": METADATA["resources"]["mysql-router-image"]["upstream-source"]}
3940

4041

4142
@pytest.mark.abort_on_fail
@@ -98,7 +99,7 @@ async def test_upgrade_from_edge(ops_test: OpsTest, charm) -> None:
9899
mysql_router_application = ops_test.model.applications[MYSQL_ROUTER_APP_NAME]
99100

100101
logger.info("Refresh the charm")
101-
await mysql_router_application.refresh(path=charm)
102+
await mysql_router_application.refresh(path=charm, resources=RESOURCES)
102103

103104
# Highest to lowest unit number
104105
refresh_order = sorted(
@@ -171,7 +172,7 @@ async def test_fail_and_rollback(ops_test: OpsTest, charm, continuous_writes) ->
171172
create_invalid_upgrade_charm(fault_charm)
172173

173174
logger.info("Refreshing mysql router with an invalid charm")
174-
await mysql_router_application.refresh(path=fault_charm)
175+
await mysql_router_application.refresh(path=fault_charm, resources=RESOURCES)
175176

176177
# Highest to lowest unit number
177178
refresh_order = sorted(
@@ -192,7 +193,7 @@ async def test_fail_and_rollback(ops_test: OpsTest, charm, continuous_writes) ->
192193
await ensure_all_units_continuous_writes_incrementing(ops_test)
193194

194195
logger.info("Re-refresh the charm")
195-
await mysql_router_application.refresh(path=charm)
196+
await mysql_router_application.refresh(path=charm, resources=RESOURCES)
196197

197198
# sleep to ensure that active status from before re-refresh does not affect below check
198199
time.sleep(15)
@@ -242,6 +243,8 @@ def create_invalid_upgrade_charm(charm_file: str | pathlib.Path) -> None:
242243
with zipfile.Path(charm_zip, "refresh_versions.toml").open("rb") as file:
243244
versions = tomli.load(file)
244245

246+
# "charm" is added during pack time using the charm refresh compatibility version stored as a git tag
247+
# so charm can be set after the release (when the version is determined) but before pack time
245248
versions["charm"] = "8.0/0.0.0"
246249

247250
with zipfile.ZipFile(charm_file, mode="a") as charm_zip:

machines/refresh_versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# https://canonical-charm-refresh.readthedocs-hosted.com/latest/refresh-versions-toml/
22

33
charm_major = 1
4-
workload = "8.0.42"
4+
workload = "8.0.44"
55

66
[snap]
77
name = "charmed-mysql"
88

99
[snap.revisions]
1010
# amd64
11-
x86_64 = "151"
11+
x86_64 = "159"
1212
# arm64
13-
aarch64 = "153"
13+
aarch64 = "157"
1414
# s390x
15-
s390x = "152"
15+
s390x = "158"

0 commit comments

Comments
 (0)