canonical / mysql-k8s-operator

A Charmed Operator for running MySQL on Kubernetes
https://charmhub.io/mysql-k8s
Apache License 2.0
8 stars 15 forks source link

fix(tests): ensure that the latest version of the secret is used #371

Closed tonyandrewmeyer closed 2 months ago

tonyandrewmeyer commented 5 months ago

Issue

As of Juju 3.1.7 (and 3.3.1, and all versions from 3.4.0 onwards) the behaviour of accessing secret content in Juju has changed:

This change is already present in ops, to prepare charms for the upcoming Juju change. This change means that one of the tests (test_on_leader_elected_secrets) fails in recent versions of ops, because it gets the original secret content, and not the updated content.

Solution

The secret owner is able to use peek (in old and new ops/Juju) so the safe change is to always use peek.

dimaqq commented 2 months ago

Seems to be the case, see https://github.com/dimaqq/operator/actions/runs/9099183244/job/25011147800

tonyandrewmeyer commented 2 months ago

@tonyandrewmeyer there don't seem to be any logical changes in the current PR state. Could it be that a fix was already included upstream?

Possibly, yes. Feel free to check if main (here) passes with ops main (or even 2.13, we haven't done anything relevant since then). Or I can do that (but not today - I probably have time Thurs/Fri, but if not can definitely get back to this once the sprint is over).

dimaqq commented 2 months ago

yep, passes. let's close this.

tonyandrewmeyer commented 2 months ago

Also verified locally.