Skip to content

2.0.0 final

Compare
Choose a tag to compare
@benhoyt benhoyt released this 25 Jan 00:52
b5cde98

This is version 2.0.0 of ops, which includes the following changes:

Major changes

  • APIs to interact with Juju Secrets, along with a testing harness. Read the tutorial or the code (#861).
  • Ops 2.0.0 requires Python 3.8+ (ops 1.5.x works down to Python 3.5). Note that Python 3.8 is the version installed by default on Ubuntu 20.04 (Focal), where Python 3.5 was installed on Ubuntu 16.04 (Xenial). As a result, ops 2.0.0 is intended for use with Juju 3.0+, which only supports Ubuntu 20.04 and above. We started using some Python 3.8 features in #871, and plan to use more in future ops 2.x releases.
  • Removed SIMULATE_CAN_CONNECT from the testing harness (#871). When we introduced can_connect it would have been a breaking change to enable it by default, so we added the SIMULATE_CAN_CONNECT global to enable it, with a warning that we'd enable it by default in a future release. This release removes the global flag and enables simulation by default.
  • Made begin_with_initial_hooks() trigger pebble-ready in the testing harness (#871). The default value of container.can_connect() is still False when using begin() ("manual mode"), but this release updates begin_with_initial_hooks() to set can_connect to True and fire pebble-ready for all containers in the charm's metadata.

Note that the SIMULATE_CAN_CONNECT and begin_with_initial_hooks() changes won't change or break your charms, however, they may break charm tests -- for example, tests that aren't expecting pebble-ready to be fired when calling begin_with_initial_hooks().

Other breaking changes

  • Deprecate controller storage: #882. This deprecate use_juju_for_storage=True (it's intended for pod-spec charms).
  • Remove Windows support: #872. Juju 3.0 no longer supports Windows deployments, so ops doesn't need to either.

Minor changes

  • Fix logging in can_connect, add tests; remove pebble.Error methods: #860. This fixes a couple of logging calls, but also removes the name() and message() methods from the ops.pebble.Error exception subclass. This is theoretically a breaking change, but it is very unlikely these methods were used by charms.
  • Add ErrorStatus #875. This adds a missing unit status value, error.
  • Add Pebble idempotency behavior #876. This makes the testing harness's emulated versions of start() and stop() match Pebble's current behaviour, which makes them idempotent: start() now does nothing if the service is already started, and similarly stop() does nothing if the service is already stopped.
  • Clarifies the warning message when local storage is chosen: "not a Kubernetes podspec charm" instead of "not a kubernetes charm" (the latter is incorrect). This was done in #882.
  • Removes the long-deprecated key argument to charm's __init__. This was done in #882.
  • Removes the deprecated (and private!) Harness._oci_resources attribute. This was done in #882.