forked from canonical/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose the Juju version via Model objects (canonical#1563)
Charm code currently needs to do `JujuVersion.from_environ()` to get the Juju version. This isn't very 'ops-y' - we expose all the other Juju state through the `Model` object, and it also means that charms instantiate `JujuVersion` objects multiple times - even though the framework has actually done this already when parsing the Juju environment variables. This PR exposes the Juju version via `Model.juju_version`, and deprecates the `JujuVersion.from_environ()` method (actual removal will presumably be in 3.0, a long time off). This also centralises all the Juju environment variable processing in the `JujuContext` object.
- Loading branch information
1 parent
e6f435e
commit 204667c
Showing
4 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters