cloud/bmaas/bmdb: correctly handle installation report
Previously we ignored the result of an installation report.
The bmdb does now store the result and correctly triggers
a recovery flow of the installation fails.
Change-Id: Ie8445cf9178ba84c6362b61ef8fa47208ab690be
Reviewed-on: https://review.monogon.dev/c/monogon/+/1865
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/bmaas/bmdb/queries_test.go b/cloud/bmaas/bmdb/queries_test.go
index facc54f..96e8dbe 100644
--- a/cloud/bmaas/bmdb/queries_test.go
+++ b/cloud/bmaas/bmdb/queries_test.go
@@ -109,8 +109,9 @@
// remain a candidate.
if err = session.Transact(ctx, func(q *model.Queries) error {
if err := q.MachineSetOSInstallationReport(ctx, model.MachineSetOSInstallationReportParams{
- MachineID: machine.MachineID,
- Generation: 9,
+ MachineID: machine.MachineID,
+ Generation: 9,
+ OsInstallationResult: model.MachineOsInstallationResultSuccess,
}); err != nil {
return err
}
@@ -124,8 +125,9 @@
// be a candidate anymore.
if err = session.Transact(ctx, func(q *model.Queries) error {
if err := q.MachineSetOSInstallationReport(ctx, model.MachineSetOSInstallationReportParams{
- MachineID: machine.MachineID,
- Generation: 10,
+ MachineID: machine.MachineID,
+ Generation: 10,
+ OsInstallationResult: model.MachineOsInstallationResultSuccess,
}); err != nil {
return err
}
@@ -229,8 +231,9 @@
}
if scenario.reportGeneration != 0 {
if err := q.MachineSetOSInstallationReport(ctx, model.MachineSetOSInstallationReportParams{
- MachineID: machine.MachineID,
- Generation: scenario.reportGeneration,
+ MachineID: machine.MachineID,
+ Generation: scenario.reportGeneration,
+ OsInstallationResult: model.MachineOsInstallationResultSuccess,
}); err != nil {
return fmt.Errorf("MachineSetOSInstallationReport: %w", err)
}