Skip to content

Commit

Permalink
install: validate update file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Nov 29, 2023
1 parent 394754a commit 104efcd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ package install

import (
"context"
"log"
"net"
"os"
"time"

"github.com/google/uuid"
"github.com/metal-toolbox/flasher/internal/model"
sm "github.com/metal-toolbox/flasher/internal/statemachine"
rctypes "github.com/metal-toolbox/rivets/condition"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

Expand All @@ -34,6 +37,11 @@ type Params struct {
}

func (i *Installer) Install(ctx context.Context, params *Params) {
_, err := os.Stat(params.File)
if err != nil {
log.Fatal(errors.Wrap(err, "unable to read firmware file"))
}

task := &model.Task{
ID: uuid.New(),
Parameters: rctypes.FirmwareInstallTaskParameters{
Expand Down

0 comments on commit 104efcd

Please sign in to comment.