Hi there! The Charm Tech team has just released version 2.12.0 of ops!
It’s available from PyPI by using pip install ops
, which should pick up the latest version. Upgrade by running pip install --upgrade ops
, and pin with ops==2.12.0
if you want a specific version.
The most important new feature is the newly added model method get_cloud_spec
that returns cloud information (CloudSpec
) where the charm is deployed, and it contains cloud credentials (CloudCredential
) that the charm can use to interact with the cloud directly. (Note that this functionality is only available on machine charms, not K8s charms.)
If your charm currently uses the credential-get
hook tool to fetch cloud credentials, now is the time to switch to this newly supported native method in the ops framework!
To make testing CloudSpec
easier in your unit tests, a new method set_cloud_spec
is added to Harness. See an example usage here.
Besides this new feature, this release also includes many bug fixes and a quality-of-life improvement to the styling of the docs. Check out the latest ops library API reference docs here.