I traced this down.
We thought we were saving the flag, but we neglected to explicitly call unitdata.kv().flush(). It appears this is generally handled for us in hook environments (e.g. charms.reactive), but during actions we need to handle it ourselves.
As an example, look at charm-vault: it explicitly calls out the need to do this in the case of successfully executing an action. Reference: https://git.launchpad.net/vault-charm/tree/src/actions/actions.py?id=fe95a83afb55733c01526e973c7f190632e30547#n230
I traced this down.
We thought we were saving the flag, but we neglected to explicitly call unitdata. kv().flush( ). It appears this is generally handled for us in hook environments (e.g. charms.reactive), but during actions we need to handle it ourselves.
As an example, look at charm-vault: it explicitly calls out the need to do this in the case of successfully executing an action. Reference: https:/ /git.launchpad. net/vault- charm/tree/ src/actions/ actions. py?id=fe95a83af b55733c01526e97 3c7f190632e3054 7#n230