Releases: canonical/operator
2.1.1 (fixes install issues with 2.1.0)
This patch release fixes issues with the missing requirements.txt
file during pip install
: #914.
2.1.0
This is version 2.1.0 of ops
, which includes the following changes:
Open-port support
We added Pythonic APIs to interface to the open-port
, close-port
, and opened-ports
hook tools in PR #905. This allows charms to ask Juju to open ports in VM charms and in K8s sidecar charms (with some issues in the latter being fixed in juju/juju#15225). See the Unit.open_port()
API reference.
Other minor changes
- Use f-strings (almost) everywhere (#889)
- Un-vendor websocket library (#891) -- thanks @tinvaan
- A few minor tweaks now that we're on Python 3.8 (#890)
- Define all dependences in requirements files (#894) -- thanks @tinvaan
- Make testing pull() raise pebble.PathError and improve docs (#897)
- Don't call secret-info-get with both ID and label (#900)
- Add ops.lib deprecation notice (#901)
- Add debug logging for custom events (#843) -- thanks @PietroPasotti
- Replace "# type: T" comments with proper variable type annotations (#904)
2.0.0 final
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 introducedcan_connect
it would have been a breaking change to enable it by default, so we added theSIMULATE_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 ofcontainer.can_connect()
is still False when usingbegin()
("manual mode"), but this release updatesbegin_with_initial_hooks()
to setcan_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()
andmessage()
methods from theops.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()
andstop()
match Pebble's current behaviour, which makes them idempotent:start()
now does nothing if the service is already started, and similarlystop()
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.
2.0.0rc2
This is a release candidate for the next major release of ops (2.0.0, which we plan to release late January). To try it in your charms, please update the ops
line in your requirements.txt
file to say:
ops==2.0.0rc2
For details of the changes since 1.x, see the 2.0.0 final release notes.
1.5.4
This is a patch release with only a few minor changes, including:
- Made harness.charm raise before begin (@PietroPasotti in #838)
- Use Storage.index instead of deprecated Storage.id (@benhoyt in #854)
- Add JujuVersion.has_secrets() (@beliaev-maksim in #855)
- Reinstate reversion of add_relation_unit ValueError to warning (@benhoyt in #856)
See the full list of commits here.
The next release will likely be 2.0.0 with Juju secrets support, and switching from minimum Python version 3.5 to 3.8.
1.5.3
What's Changed
This is a bug-fix/patch release for ops 1.5
advancing the Operator Framework in a number of key areas including:
Typing
Typing is now complete for all ops
modules and static checks for all using pyright
.
- Typing framework.py by @PietroPasotti in #772
- Typed ops.pebble.py by @PietroPasotti in #773
- Typing charm.py by @PietroPasotti in #791
- Fix model types by @PietroPasotti in #810
- Typing main by @PietroPasotti in #811
- Typed
ops/testing.py
by @PietroPasotti in #828
Documentation
Various documentation improvements.
- Update docs for unset param in update_config by @swalladge in #768
- cleaned up logging output by @PietroPasotti in #797
- Fix docstring by @zmraul in #802
- Added further documentation to define_event function in framework.py #830 by @nishant-dash in #831
- Documented and checked ActionEvent.set_results with "Stdout" key by @PietroPasotti in #809
- doc fix for config-changed by @PietroPasotti in #804
Testing
The Harness now tries harder to behave like production code would.
- Make Harness more strict in validating relation data contents (on write) by @PietroPasotti in #786
- Address storage testing quirks by @rwcarlsen in #763
- fixed issues with relation data read by @PietroPasotti in #795
- Remove overzealous Harness.add_storage error check. by @rwcarlsen in #781
- added config backend to simulate more closely juju's own by @PietroPasotti in #787
- Include departing unit info for harness-initiated events by @rwcarlsen in #790
Improved error reporting
- Improved error message for invalid storage key usage by @rwcarlsen in #771
- Better error for relation data access in relation-broken events by @rwcarlsen in #765
- downgrade breaking-change exception to just a warning by @rwcarlsen in #822
Bugfixes
- Fix incorrect kwarg handling in testing backend storage_list by @rwcarlsen in #820
- Allow network-get to return hostnames where previously IPaddr were expected by @PietroPasotti in #823
- Use --file for relation-set; avoid shell argument length limits by @rbarry82 in #805
- Fixed bug in ops.Model where non-string keys could be used to write relation data by @PietroPasotti in #788
Misc
- Added a very basic smoke test. Run it with
tox -e smoke
by @pengale in #800 - require tests to pass on a commit before we publish it to pypi by @rwcarlsen in #815
- Remove harcoded value for self.model_uuid by @Abuelodelanada in #782
- Test observe(decorated-method) by @PietroPasotti in #808
New Contributors
- @swalladge made their first contribution in #768
- @zmraul made their first contribution in #802
- @nishant-dash made their first contribution in #831
Full Changelog: 1.5.2...1.5.3
1.5.2
This is a bug-fix/patch release for ops 1.5 addressing a few important issues including:
- Fix harness model uuid to use the correct/current format used by juju (#782).
- Include the missing departing unit attribute on relation-departed events when using the harness (#790).
- Remove restrictive limits on the number and size of relation data items that can be set (#805).
- Fix type annotations that were causing failures in Ubuntu xenial based environments - i.e. python 3.5 (#810).
Notably, this release was carefully crafted to not break your code. If it does - please complain loudly and we will address problems after completing a good, forceful facepalm.
1.5.1
1.5.0
The Operator Framework team is proud to release version 1.5.0 of the Operator Framework! This is a modestly sized release with a few new, non breaking features.
Highlights
- Harness support for simulating storage mounts during testing - allowing disk IO to mounted filepaths and sharing data between shared mounts in charm and workload (via e.g. pebble operations) containers. This should "just work" - as long as you use the storage mount paths provided via e.g.
self.model.storages['storage-name'][0].location
which you should already be doing anyway (right?). - New
Container.push_path
andContainer.pull_path
methods for recursively pushing/pulling directories to/from workload containers. - We've begun to implement complete type annotations to improve auto-completion and robustness. Over the next release or so type annotation coverage will continue to improve.
Complete List of Changes
- Modify Harness.set_leader to be more robust, less finicky by @rwcarlsen in #733
- Harness add_layer merge support. by @alesstimec in #738
- Edited test charm to support metadata v2, drop untested v1 fields by @pengale in #748
- Harness: support mocking storage mounts by @rwcarlsen in #734
- More typing by @PietroPasotti in #744
- Typing for storage.py by @PietroPasotti in #749
- Fixes address info value getter by @PietroPasotti in #757
- Typing utils by @PietroPasotti in #755
- PR template. by @pengale in #746
- Typing for model.py by @PietroPasotti in #756
- Recursively push+pull files/dirs to containers by @rwcarlsen in #754
New Contributors
- @alesstimec made their first contribution in #738
Full Changelog: 1.4.0...1.5.0
1.4.0
The Operator Framework team is proud to release version 1.4.0 of the Operator Framework!
This is largely a bugfix release, but it also includes a few small, non breaking features.
Highlights
- Memory efficient push of file(s) to pebble
- Testing harness more closely matches live environment behavior
- Added flag to test with "real pebble". Use this to write tests that use an actual running Pebble rather than a fixture
- Add Container.isdir and Container.exists helpers
Complete List of Changes
- Memory-efficient push via pebble by @Vultaire in #666
- remove_path succeeds even if path does not exist by @sed-i in #677
- Make the storage harness work when metadata keys have hyphens by @rbarry82 in #680
- docfix: mention
add_relation_unit
in the docstring foradd_relation
by @sed-i in #683 - conformed list_files behaviour on failure with pebble's by @PietroPasotti in #686
- Add real pebble tests to our CI by @rwcarlsen in #687
- FIX remove_path docstring to relfect current behaviour. by @Abuelodelanada in #698
- Fix incorrect variadic arg wrangling in get_services by @rwcarlsen in #702
- add tox config for real pebble tests by @rwcarlsen in #704
- skip broken ipython version to fix CI by @rwcarlsen in #710
- Add Container.isdir and Container.exists helpers by @rwcarlsen in #709
- Added notes on cutting a release to HACKING.md by @pengale in #714
- Avoid issuing relation_changed events with no data delta by @mmanciop in #705
- Updated docs on planned units. by @pengale in #716
- expose the departing unit on RelationDeparted events by @rwcarlsen in #712
- DEPATING -> DEPARTING by @PietroPasotti in #717
- Implement send-signal for harness by @sed-i in #715
- notes about documentation for contributers by @rwcarlsen in #720
- Fixing updated link in docstrings by @Abuelodelanada in #722
- Harness: add test for an empty config file by @sed-i in #728
- begin_with_initial_hooks now sets post install status correctly by @pengale in #727
- Add checks config fields and get_checks API by @benhoyt in #668
- Memory-efficient pull via pebble by @Vultaire in #667
New Contributors
- @PietroPasotti made their first contribution in #686
- @rwcarlsen made their first contribution in #687
- @Abuelodelanada made their first contribution in #698
Full Changelog: 1.3.0...1.4.0