State Management -- Some Personal Thoughts and Notes #24
IronCore864
started this conversation in
Ideas
Replies: 1 comment
-
I agree with most of the points you mentioned above. Today I will write a demo based on the suggestions mentioned above, and then we discuss it further. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
0. What's Needed in the State
What else?
1. Code Structure
See here.
According to the second paragraph, the following is reasonable:
2. The Relationship of config/backend/state/state manager/plugin engine
I had a quick look at the source code of Terraform, which didn't do a clean job here. It mixes config/state/backend into a context, then executes, and the backend calls state manager, and vice versa.
I think we can improve the idea by standing on the shoulder of Terraform.
Our original design is here.
NOTE: in the current MVP version, the configuration loader isn't strictly called by the plugin engine.
The general idea is like the builder pattern, where the plugin engine acts as a director and coordinates the config, state, and backend.
The relationship between backend and state also baffles me, which leads to the next section:
3. The Relationship Between State Manager and Backend
There are a few structural ambiguities:
If we think about how the state manager is going to be used from the standpoint of the code inside the plugin engine:
Summary
Hence, the following:
The state manager decides what to do and which interface of the backend to call, based on the result, action, and the previous state. Examples:
Beta Was this translation helpful? Give feedback.
All reactions