Make for-update transaction in enable/disable
Since the operations read and write from db as part of the refresh status.
@@ -1774,6 +1774,8 @@ func (b *bareMetalInventory) DisableHost(ctx context.Context, params installer.D
txSuccess := false
tx := b.db.Begin()
+ tx = transaction.AddForUpdateQueryOption(tx)
+
defer func() {
if !txSuccess {
log.Error("update cluster failed")
@@ -1828,6 +1830,8 @@ func (b *bareMetalInventory) EnableHost(ctx context.Context, params installer.En
txSuccess := false
tx := b.db.Begin()
+ tx = transaction.AddForUpdateQueryOption(tx)
+
defer func() {
if !txSuccess {
log.Error("update cluster failed")
