Skip to content

Commit

Permalink
distro/rhel: fail on OSTree options for non-OSTree images
Browse files Browse the repository at this point in the history
Modify the `checkOptions()` function to return an `error` in case the
OSTree image options are specified for a non-OSTree based image.
Previously, these would be silently ignored.

Signed-off-by: Tomáš Hozza <[email protected]>
  • Loading branch information
thozza authored and achilleas-k committed Nov 27, 2024
1 parent e525754 commit 78df054
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/distro/rhel/imagetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ func (t *ImageType) Manifest(bp *blueprint.Blueprint,
// checkOptions checks the validity and compatibility of options and customizations for the image type.
// Returns ([]string, error) where []string, if non-nil, will hold any generated warnings (e.g. deprecation notices).
func (t *ImageType) checkOptions(bp *blueprint.Blueprint, options distro.ImageOptions) ([]string, error) {
if !t.RPMOSTree && options.OSTree != nil {
return nil, fmt.Errorf("OSTree is not supported for %q", t.Name())
}

if t.arch.distro.CheckOptions != nil {
return t.arch.distro.CheckOptions(t, bp, options)
}
Expand Down

0 comments on commit 78df054

Please sign in to comment.