Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distro: fail on OSTree image options being provided for non-OSTree based image types #1071

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

thozza
Copy link
Member

@thozza thozza commented Nov 27, 2024

Modify checkOptions() of all distributions to fail if the OSTree image options are provided for the non-OSTree-based image type. Previously, these would be silently ignored. Add a unit test to verify the behavior.

Modify unit tests common for all distros to add OSTree image options to
the `ImageOptions` only for OSTree-based images. Alternatively, some
unit tests that are focused on OSTree now skip testing non-OSTree image
types.

Signed-off-by: Tomáš Hozza <[email protected]>
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]>
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]>
Add a common distro unit test, which verifies that specifying OSTree
image options for non-OSTree based image types produces an error, while
specifying it for OSTree based images doesn't.

Signed-off-by: Tomáš Hozza <[email protected]>
@achilleas-k achilleas-k added this pull request to the merge queue Nov 27, 2024
Merged via the queue into osbuild:main with commit 929d1b1 Nov 27, 2024
19 checks passed
@thozza thozza deleted the el10-ostree-check branch November 28, 2024 07:33
thozza added a commit to thozza/osbuild-images that referenced this pull request Dec 6, 2024
This was missed in PR#1071 [0].

[0] osbuild#1071

Signed-off-by: Tomáš Hozza <[email protected]>
thozza added a commit to thozza/osbuild-images that referenced this pull request Dec 6, 2024
This was missed in PR#1071 [0].

[0] osbuild#1071

Signed-off-by: Tomáš Hozza <[email protected]>
thozza added a commit to thozza/osbuild-composer that referenced this pull request Dec 7, 2024
Previously, the `OSTree` property in the Weldr API `ComposeRequest`
struct was not a pointer to the `ostree.ImageOptions` type. As a result,
it was initialized to an empty struct, even if not set in the client API
call.

As a result, the `OSTree` property in the `distro.ImageOptions` was
always not `nil`, when initializing the osbuild manifest. However, after
a change in `osbuild/images` [0], providing OSTree options for
non-OSTree image types is no longer considered valid. This caused a
failure to submit a new compose for any non-OSTree image type.

Change the `OSTree` property in Weldr `ComposeRequest` to be a pointer
and mark it as optional.

[0] osbuild/images#1071

Signed-off-by: Tomáš Hozza <[email protected]>
ondrejbudai pushed a commit to osbuild/osbuild-composer that referenced this pull request Dec 9, 2024
Previously, the `OSTree` property in the Weldr API `ComposeRequest`
struct was not a pointer to the `ostree.ImageOptions` type. As a result,
it was initialized to an empty struct, even if not set in the client API
call.

As a result, the `OSTree` property in the `distro.ImageOptions` was
always not `nil`, when initializing the osbuild manifest. However, after
a change in `osbuild/images` [0], providing OSTree options for
non-OSTree image types is no longer considered valid. This caused a
failure to submit a new compose for any non-OSTree image type.

Change the `OSTree` property in Weldr `ComposeRequest` to be a pointer
and mark it as optional.

[0] osbuild/images#1071

Signed-off-by: Tomáš Hozza <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Dec 9, 2024
This was missed in PR#1071 [0].

[0] #1071

Signed-off-by: Tomáš Hozza <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants