fix: harden model catalog projections
This commit is contained in:
@@ -528,8 +528,13 @@ func piCommand(ctx context.Context, installation config.Installation, runner com
|
||||
defer func() { _ = lock.Release() }()
|
||||
}
|
||||
if args[0] == "restart" || args[0] == "update" || args[0] == "rollback" {
|
||||
if err := modelprojection.Generate(installation); err != nil {
|
||||
return commandUsageError(stderr, "installation model catalog could not be projected: "+err.Error())
|
||||
drift, err := modelprojection.Check(installation)
|
||||
if err != nil {
|
||||
return commandUsageError(stderr, "installation model catalog could not be verified: "+err.Error())
|
||||
}
|
||||
if len(drift) > 0 {
|
||||
return commandUsageError(stderr,
|
||||
"installation model catalog changed; run tht start to apply the complete runtime projection")
|
||||
}
|
||||
}
|
||||
controlled := compose.InstallationRunner{Installation: installation, Runner: runner}
|
||||
|
||||
Reference in New Issue
Block a user