-
Notifications
You must be signed in to change notification settings - Fork 50
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
blueprints: fix filesystem customizations to allow toml Undecoded() #951
Draft
mvo5
wants to merge
1
commit into
osbuild:main
Choose a base branch
from
mvo5:toml-undecoded-only-primitive-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvo5
added a commit
to mvo5/bootc-image-builder
that referenced
this pull request
Sep 24, 2024
This commit partially reverts PT#549 to unblock filesystem customizations in bib. This is a short term fix and we should revert and do something smarter like osbuild/images#951 or see if we can do better in the toml unmarshaling. But to unblock toml customizations this is a (IMHO) reasonable first step. Closes: osbuild#655
The current toml filesytem customizations will decode a `FilesystemCustomization` as a map[string]interface{}. This means that the underlying toml engine will not konw what keys inside the map are decoded and which are not decoded. This lead to the issue osbuild/bootc-image-builder#655 in `bootc-image-builder` where we check if we have unencoded entries and if so error (in this case incorrectly). This commit fixes the issue by moving the toml decoding from the struct/map[string]interface{} to primitive types. It's a bit ugly as is (partly because of the limited go type system) but with that the tests pass and len(meta.Undecoded()) is the expected zero. I opened BurntSushi/toml#425 to see if there is another way via a custom unmarshaler.
mvo5
force-pushed
the
toml-undecoded-only-primitive-types
branch
from
September 24, 2024 14:27
709353c
to
f55bad7
Compare
I submited an alternative idea upstream BurntSushi/toml#426 |
mvo5
added a commit
to mvo5/bootc-image-builder
that referenced
this pull request
Sep 25, 2024
This commit partially reverts PT#549 to unblock filesystem customizations in bib. This is a short term fix and we should revert and do something smarter like osbuild/images#951 or see if we can do better in the toml unmarshaling. But to unblock toml customizations this is a (IMHO) reasonable first step. Closes: osbuild#655
github-merge-queue bot
pushed a commit
to osbuild/bootc-image-builder
that referenced
this pull request
Sep 25, 2024
This commit partially reverts PT#549 to unblock filesystem customizations in bib. This is a short term fix and we should revert and do something smarter like osbuild/images#951 or see if we can do better in the toml unmarshaling. But to unblock toml customizations this is a (IMHO) reasonable first step. Closes: #655
This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current toml filesytem customizations will decode a
FilesystemCustomization
as a map[string]interface{}. This means that the underlying toml engine will not konw what keys inside the map are decoded and which are not decoded. This lead to the issue osbuild/bootc-image-builder#655 inbootc-image-builder
where we check if we have unencoded entries and if so error (in this case incorrectly).This commit fixes the issue by moving the toml decoding from the struct/map[string]interface{} to primitive types. It's a bit ugly as is (partly because of the limited go type system) but with that the tests pass and len(meta.Undecoded()) is the expected zero.
I opened BurntSushi/toml#425 to see if there is another way via a custom unmarshaler.