Skip to content

Commit

Permalink
Return when there is an error in the config
Browse files Browse the repository at this point in the history
When having an error due wrong configuration of the controller, return
the error.

Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed Nov 12, 2023
1 parent 992c0fd commit a751cbf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/settings/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,27 @@ type Migration struct {
func (r *Migration) Load() (err error) {
r.MaxInFlight, err = getPositiveEnvLimit(MaxVmInFlight, 20)
if err != nil {
err = liberr.Wrap(err)
return liberr.Wrap(err)
}
r.HookRetry, err = getPositiveEnvLimit(HookRetry, 3)
if err != nil {
err = liberr.Wrap(err)
return liberr.Wrap(err)
}
r.ImporterRetry, err = getPositiveEnvLimit(ImporterRetry, 3)
if err != nil {
err = liberr.Wrap(err)
return liberr.Wrap(err)
}
r.PrecopyInterval, err = getPositiveEnvLimit(PrecopyInterval, 60)
if err != nil {
err = liberr.Wrap(err)
return liberr.Wrap(err)
}
r.SnapshotRemovalTimeout, err = getPositiveEnvLimit(SnapshotRemovalTimeout, 120)
if err != nil {
err = liberr.Wrap(err)
return liberr.Wrap(err)
}
r.SnapshotStatusCheckRate, err = getPositiveEnvLimit(SnapshotStatusCheckRate, 10)
if err != nil {
err = liberr.Wrap(err)
return liberr.Wrap(err)
}
if virtV2vImage, ok := os.LookupEnv(VirtV2vImage); ok {
if cold, warm, found := strings.Cut(virtV2vImage, "|"); found {
Expand All @@ -92,11 +92,11 @@ func (r *Migration) Load() (err error) {
r.VirtV2vDontRequestKVM = getEnvBool(VirtV2vDontRequestKVM, false)
r.CDIExportTokenTTL, err = getPositiveEnvLimit(CDIExportTokenTTL, 0)
if err != nil {
err = liberr.Wrap(err)
return liberr.Wrap(err)
}
r.FileSystemOverhead, err = getNonNegativeEnvLimit(FileSystemOverhead, 10)
if err != nil {
err = liberr.Wrap(err)
return liberr.Wrap(err)
}

return
Expand Down

0 comments on commit a751cbf

Please sign in to comment.