Skip to content

Commit 01f26e6

Browse files
committed
algorithm sketch
Signed-off-by: Victor Moene <victor.moene@northern.tech>
1 parent d36ce62 commit 01f26e6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

vm-config.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ Details about the current state can be found in /home/user/.cfengine/cf-remote/c
7373
cf-remote destroy config.yaml
7474
```
7575

76+
# Algorithm
77+
78+
1. Resolve templates in config
79+
2. Validate resolved config using `schema` library
80+
3. Load old state (cloud_state.json)
81+
4. Transform validated config (new state) into same format as old state
82+
5. Compute diffs between old state and new state. Return a list of tuple (path, before, after)
83+
6. Map diffs to Change object containing the type of change (ex: install), the status (ex: pending) and the dependencies (vm must be already spawned)
84+
7. schedule the list of change objects with topological sort or other algorithm and run each change using cf-remote's commands
85+
8. save new state to cloud_state.json
86+
7687
# Future features
7788

7889
- inlining (being able to split config in smaller subtrees)

0 commit comments

Comments
 (0)