Skip to content

Commit 3e96426

Browse files
committed
WIP: updated condition
1 parent a1b2de6 commit 3e96426

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

internal/orchestrator/updates.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ func (o *Orchestrator) eventUpdate(ctx context.Context, evt *v1types.ConditionUp
510510
},
511511
).Inc()
512512

513+
// TODO: we'd want to keep task data around, and let it be cleaned up by the reconciler or the key TTL
514+
// for this events/controllers needs to purge a Task if it currently exists.
515+
//
513516
// for now the task deletion error is informative, since not all controllers use Tasks as yet.
514517
delTaskErr := status.DeleteTask(o.facility, evt.Kind, evt.ConditionUpdate.ServerID.String())
515518
if delTaskErr != nil {

pkg/api/v1/routes/handlers.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,29 +288,29 @@ func (r *Routes) firmwareInstallComposite(serverID uuid.UUID, fwtp rctypes.Firmw
288288
// set PXE boot always &&
289289
// set power cycle server
290290

291-
fwOobCondition := &rctypes.Condition{
292-
Kind: rctypes.FirmwareInstall,
291+
fwInbCondition := &rctypes.Condition{
292+
Kind: rctypes.FirmwareInstallInband,
293293
Version: rctypes.ConditionStructVersion,
294294
Parameters: fwtp.MustJSON(),
295295
State: rctypes.Pending,
296296
CreatedAt: createTime,
297297
}
298298

299-
fwInbCondition := &rctypes.Condition{
300-
Kind: rctypes.FirmwareInstallInband,
299+
fwOobCondition := &rctypes.Condition{
300+
Kind: rctypes.FirmwareInstall,
301301
Version: rctypes.ConditionStructVersion,
302302
Parameters: fwtp.MustJSON(),
303303
State: rctypes.Pending,
304304
CreatedAt: createTime,
305305
}
306306

307-
//invCondition := &rctypes.Condition{
308-
// Kind: rctypes.Inventory,
309-
// Version: rctypes.ConditionStructVersion,
310-
// Parameters: rctypes.MustDefaultInventoryJSON(serverID),
311-
// State: rctypes.Pending,
312-
// CreatedAt: createTime,
313-
//}
307+
invCondition := &rctypes.Condition{
308+
Kind: rctypes.Inventory,
309+
Version: rctypes.ConditionStructVersion,
310+
Parameters: rctypes.MustDefaultInventoryJSON(serverID),
311+
State: rctypes.Pending,
312+
CreatedAt: createTime,
313+
}
314314

315315
releaseCond := &rctypes.Condition{
316316
Kind: rctypes.BrokerReleaseServer,
@@ -330,8 +330,8 @@ func (r *Routes) firmwareInstallComposite(serverID uuid.UUID, fwtp rctypes.Firmw
330330

331331
serverConditions := &rctypes.ServerConditions{}
332332
if r.enableServerReservation {
333-
// serverConditions.Conditions = append(serverConditions.Conditions, acquireCond, fwOobCondition, invCondition, fwInbCondition, releaseCond)
334-
serverConditions.Conditions = append(serverConditions.Conditions, acquireCond, fwOobCondition, fwInbCondition, releaseCond)
333+
serverConditions.Conditions = append(serverConditions.Conditions, acquireCond, fwInbCondition, fwOobCondition, invCondition, releaseCond)
334+
//serverConditions.Conditions = append(serverConditions.Conditions, acquireCond, fwInbCondition, releaseCond)
335335
} else {
336336
// serverConditions.Conditions = append(serverConditions.Conditions, fwOobCondition, invCondition)
337337
serverConditions.Conditions = append(serverConditions.Conditions, fwOobCondition)

0 commit comments

Comments
 (0)