operator icon indicating copy to clipboard operation
operator copied to clipboard

The framework docs (inline and on discourse) should distinguish data loaded on hook invocation, vs. data that is updated on demand

Open pengale opened this issue 3 years ago • 1 comments

Most of the model data available in framework.model is populated on hook invocation -- e.g., it is loaded from the hook environment when a "run" of ops starts, and is not updated until the next hook fires.

There are some exceptions. The hook tool invoked by unit.is_leader actually queries the controller when the hook is run, meaning that we can generally rely on the state being up to date.

We should make it clear which routines (container liveness checks, leadership checks) present charm authors with as up-to-date as possible information, and which routines present data that may not reflect an as yet unprocessed change to the model state.

pengale avatar Apr 28 '22 16:04 pengale

Container.can_connect is another important one that is "up-to-date".

rwcarlsen avatar May 10 '22 14:05 rwcarlsen

Duplicate of #767 ? Will add can_connect to my infographic

PietroPasotti avatar Aug 22 '22 08:08 PietroPasotti

docs: https://discourse.charmhub.io/t/talking-to-a-workload-control-flow-from-a-to-z/6161

PietroPasotti avatar Aug 22 '22 08:08 PietroPasotti

Yeah - my bad on the dup. Let's migrate discussion to that issue since there are more words there. I've posted/quoted @pengale's content on that issue thread.

rwcarlsen avatar Aug 22 '22 19:08 rwcarlsen