mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
treat the old config as null when we install/recover for the first time (#1297)
* treat the old config as null when we install/recover for the first time * reduce scope of change Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
committed by
GitHub
parent
86823e063a
commit
a95c9f4f2d
@@ -348,6 +348,12 @@ pub fn configure_rec<'a, Db: DbHandle>(
|
|||||||
.get(db, true)
|
.get(db, true)
|
||||||
.await?;
|
.await?;
|
||||||
let volumes = pkg_model.clone().manifest().volumes().get(db, true).await?;
|
let volumes = pkg_model.clone().manifest().volumes().get(db, true).await?;
|
||||||
|
let is_needs_config = !*pkg_model
|
||||||
|
.clone()
|
||||||
|
.status()
|
||||||
|
.configured()
|
||||||
|
.get(db, true)
|
||||||
|
.await?;
|
||||||
|
|
||||||
// get current config and current spec
|
// get current config and current spec
|
||||||
let ConfigRes {
|
let ConfigRes {
|
||||||
@@ -473,7 +479,9 @@ pub fn configure_rec<'a, Db: DbHandle>(
|
|||||||
|
|
||||||
// handle dependents
|
// handle dependents
|
||||||
let dependents = pkg_model.clone().current_dependents().get(db, true).await?;
|
let dependents = pkg_model.clone().current_dependents().get(db, true).await?;
|
||||||
let prev = old_config.map(Value::Object).unwrap_or_default();
|
let prev = if is_needs_config { None } else { old_config }
|
||||||
|
.map(Value::Object)
|
||||||
|
.unwrap_or_default();
|
||||||
let next = Value::Object(config.clone());
|
let next = Value::Object(config.clone());
|
||||||
for (dependent, dep_info) in dependents.iter().filter(|(dep_id, _)| dep_id != &id) {
|
for (dependent, dep_info) in dependents.iter().filter(|(dep_id, _)| dep_id != &id) {
|
||||||
// check if config passes dependent check
|
// check if config passes dependent check
|
||||||
|
|||||||
Reference in New Issue
Block a user