Skip to content

Commit

Permalink
distro/rhel: always return warnings from checkOptions()
Browse files Browse the repository at this point in the history
Always return the warnings list from checkOptions() so that future
modifications or reshuffling of the checks doesn't drop any warnings
collected before the return.
  • Loading branch information
achilleas-k committed Dec 5, 2024
1 parent d070e15 commit 2022fca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/distro/rhel/rhel8/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ func checkOptions(t *rhel.ImageType, bp *blueprint.Blueprint, options distro.Ima

if options.OSTree != nil {
if err := options.OSTree.Validate(); err != nil {
return nil, err
return warnings, err
}
}

if t.BootISO && t.RPMOSTree {
// ostree-based ISOs require a URL from which to pull a payload commit
if options.OSTree == nil || options.OSTree.URL == "" {
return nil, fmt.Errorf("boot ISO image type %q requires specifying a URL from which to retrieve the OSTree commit", t.Name())
return warnings, fmt.Errorf("boot ISO image type %q requires specifying a URL from which to retrieve the OSTree commit", t.Name())
}

if t.Name() == "edge-simplified-installer" {
Expand Down
4 changes: 2 additions & 2 deletions pkg/distro/rhel/rhel9/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ func checkOptions(t *rhel.ImageType, bp *blueprint.Blueprint, options distro.Ima

if options.OSTree != nil {
if err := options.OSTree.Validate(); err != nil {
return nil, err
return warnings, err
}
}

if t.BootISO && t.RPMOSTree {
// ostree-based ISOs require a URL from which to pull a payload commit
if options.OSTree == nil || options.OSTree.URL == "" {
return nil, fmt.Errorf("boot ISO image type %q requires specifying a URL from which to retrieve the OSTree commit", t.Name())
return warnings, fmt.Errorf("boot ISO image type %q requires specifying a URL from which to retrieve the OSTree commit", t.Name())
}

if t.Name() == "edge-simplified-installer" {
Expand Down

0 comments on commit 2022fca

Please sign in to comment.