Skip to content

Commit

Permalink
WIP: updated condition
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Jun 6, 2024
1 parent a1b2de6 commit 3e96426
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions internal/orchestrator/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ func (o *Orchestrator) eventUpdate(ctx context.Context, evt *v1types.ConditionUp
},
).Inc()

// TODO: we'd want to keep task data around, and let it be cleaned up by the reconciler or the key TTL
// for this events/controllers needs to purge a Task if it currently exists.
//
// for now the task deletion error is informative, since not all controllers use Tasks as yet.
delTaskErr := status.DeleteTask(o.facility, evt.Kind, evt.ConditionUpdate.ServerID.String())
if delTaskErr != nil {
Expand Down
26 changes: 13 additions & 13 deletions pkg/api/v1/routes/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,29 +288,29 @@ func (r *Routes) firmwareInstallComposite(serverID uuid.UUID, fwtp rctypes.Firmw
// set PXE boot always &&
// set power cycle server

fwOobCondition := &rctypes.Condition{
Kind: rctypes.FirmwareInstall,
fwInbCondition := &rctypes.Condition{
Kind: rctypes.FirmwareInstallInband,
Version: rctypes.ConditionStructVersion,
Parameters: fwtp.MustJSON(),
State: rctypes.Pending,
CreatedAt: createTime,
}

fwInbCondition := &rctypes.Condition{
Kind: rctypes.FirmwareInstallInband,
fwOobCondition := &rctypes.Condition{
Kind: rctypes.FirmwareInstall,
Version: rctypes.ConditionStructVersion,
Parameters: fwtp.MustJSON(),
State: rctypes.Pending,
CreatedAt: createTime,
}

//invCondition := &rctypes.Condition{
// Kind: rctypes.Inventory,
// Version: rctypes.ConditionStructVersion,
// Parameters: rctypes.MustDefaultInventoryJSON(serverID),
// State: rctypes.Pending,
// CreatedAt: createTime,
//}
invCondition := &rctypes.Condition{
Kind: rctypes.Inventory,
Version: rctypes.ConditionStructVersion,
Parameters: rctypes.MustDefaultInventoryJSON(serverID),
State: rctypes.Pending,
CreatedAt: createTime,
}

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

serverConditions := &rctypes.ServerConditions{}
if r.enableServerReservation {
// serverConditions.Conditions = append(serverConditions.Conditions, acquireCond, fwOobCondition, invCondition, fwInbCondition, releaseCond)
serverConditions.Conditions = append(serverConditions.Conditions, acquireCond, fwOobCondition, fwInbCondition, releaseCond)
serverConditions.Conditions = append(serverConditions.Conditions, acquireCond, fwInbCondition, fwOobCondition, invCondition, releaseCond)
//serverConditions.Conditions = append(serverConditions.Conditions, acquireCond, fwInbCondition, releaseCond)
} else {
// serverConditions.Conditions = append(serverConditions.Conditions, fwOobCondition, invCondition)
serverConditions.Conditions = append(serverConditions.Conditions, fwOobCondition)
Expand Down

0 comments on commit 3e96426

Please sign in to comment.