Idempotent spawn#145
Conversation
|
Thanks for submitting a pull request! Maybe @larsewi can review this? |
0631db5 to
85b345c
Compare
Interesting. My thinking was that we could evaluate the current (new) config, to the "actual state" somehow, not the previous config. For example, what would happen if:
My idea was that if you run the new config in this case, it should recognize that 3 hosts are correctly set up, and it just needs to spawn the last one. |
olehermanse
left a comment
There was a problem hiding this comment.
Needs to be rebased, has conflicts.
Please open a separate PR to document (markdown) how the spawning and up command should work. We should discuss and decide on this before we continue with the implementation (code), I think. README.md has a very short section, need to expand this with details on how current (actual) state is determined, and how to find the diffs of what to change / fix.
That was my initial idea as well but then this would require parsing the state.json, which doesn't contain the exact same information than the config. For example, the cfengine installation (what hub it is bootstrapped to, etc..). |
Signed-off-by: Victor Moene <victor.moene@northern.tech>
Here is a first iteration of idempotent spawn. It can probably be optimized in further iterations, by for example spawning in "parallel"
The way it works is that it will update the environment by comparing the given yaml config to the previously successfully run yaml config. If we want tp ignore the previously run config we can run using the
--resetflag.