Skip to content

Commit

Permalink
purge unused Task.InstallFirmwares field
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed May 4, 2023
1 parent 4c09777 commit 5649a62
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
3 changes: 0 additions & 3 deletions internal/model/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ type Task struct {
// these are generated in the `pending` stage of the task.
ActionsPlanned Actions

// InstallFirmwares is the list of firmware planned for install.
InstallFirmwares []*Firmware

// Parameters for this task
Parameters TaskParameters

Expand Down
7 changes: 0 additions & 7 deletions internal/outofband/actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
func newTaskFixture(status string) *model.Task {
task := &model.Task{}
task.Status = string(status)
task.InstallFirmwares = fixtures.Firmware

// task.Parameters.Device =
return task
Expand Down Expand Up @@ -116,9 +115,6 @@ func Test_ActionStateMachine_Run_Succeeds(t *testing.T) {
firmware[0].Checksum = blobChecksum
firmware[0].FileName = "dummy.bin"

// set firmware planned for install
task.InstallFirmwares = []*model.Firmware{firmware[0]}

action := model.Action{
ID: "foobar",
TaskID: task.ID.String(),
Expand Down Expand Up @@ -180,9 +176,6 @@ func Test_ActionStateMachine_Run_Fails(t *testing.T) {
firmware[0].Checksum = blobChecksum
firmware[0].FileName = "dummy.bin"

// set firmware planned for install
task.InstallFirmwares = []*model.Firmware{firmware[0]}

action := model.Action{
ID: "foobar",
TaskID: task.ID.String(),
Expand Down
1 change: 0 additions & 1 deletion internal/statemachine/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func newTaskFixture(t *testing.T, state string) *model.Task {
t.Fatal(err)
}

task.InstallFirmwares = firmwares
task.Parameters.AssetID = asset1

return task
Expand Down
7 changes: 0 additions & 7 deletions internal/worker/task_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ func (h *taskHandler) ValidatePlan(t sw.StateSwitch, args sw.TransitionArgs) (bo
return false, errors.Wrap(ErrSaveTask, ErrTaskTypeAssertion.Error())
}

if len(task.InstallFirmwares) == 0 {
return false, errors.Wrap(errTaskPlanValidate, "no firmwares planned for install")
}

// validate task has action plans listed
if len(task.ActionsPlanned) == 0 {
return false, errors.Wrap(errTaskPlanValidate, "no task actions planned")
Expand Down Expand Up @@ -278,9 +274,6 @@ func (h *taskHandler) planInstall(_ *sm.HandlerContext, task *model.Task, firmwa
// include action state machines that will be executed.
actionMachines = append(actionMachines, m)

// include applicable firmware in planned
task.InstallFirmwares = append(task.InstallFirmwares, firmwares[idx])

newAction := model.Action{
ID: actionID,
TaskID: task.ID.String(),
Expand Down

0 comments on commit 5649a62

Please sign in to comment.