-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hook context: Add a clear boundary between ops and juju #1075
Comments
imagine what you can do with that plus access to a holistic https://github.com/PietroPasotti/jhack/blob/main/jhack/scenario/integrations/darkroom.py
|
I agree this would be a nice separation (though I'm not convinced we'd want to make it public / a guaranteed part of the API). I think main.py is a bit messy right now and this would help separate out the concerns. It also seems to me this is bound up with the event type, and there's a fair bit of overlap between |
Circled back to this issue today. Here's the summary:
Related: https://discourse.charmhub.io/t/charming-without-any-observers/13120 |
This is a roadmap item for 24.10. We'll implement something like this, though not necessarily with this exact API. |
Hook tools (1, 2) and pebble.py already draw a pretty clear boundary between ops and juju, but there is a key part missing: environment variables.
Wouldn't it be nice if the juju context could be represented as a plain, flat class directly from envvars, and without any deps? And then reused within ops for whatever purpose, without ever again hardcoding envvar string literals?
Conceptual design for hook context
Here's how a charm could look like
Advantages
Optional
in type hints (?)Far fetched musings
framework.observe()
.The text was updated successfully, but these errors were encountered: