-
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
blueprint: fix filesystem customization parsing #885
Conversation
The toml tag and bootc-image-builder uses the new key "minsize", but the custom unmarshaller still referred to the old "size" key. Unfortunately, the test was also wrong. This commit changes both the unmarshaller and the test to use new "minsize" key, hopefully finally bringing sanity to this code. I also changed some require.Nil calls to require.NoError to make the test results more readable if these tests fail.
There's no functional change except for a minor adjustements of an error. I just made sure that everything refers to minsize instead of size. Also, I removed a comment that mentioned that the keys are called differently in json than in toml, but that's no longer true. See e.g. the previous commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This looks fine, thanks for fixing this. I was about to approve but there is the open question about backward compatiblity (I assume we do not need that as this is a bug but wanted to double check).
I would also encourage two small test tweaks that I added, happy to push them directly to this branch if people are okay with or alternatively push them as a followup :)
@@ -23,16 +23,16 @@ version = "2.4.*" | |||
|
|||
[[customizations.filesystem]] | |||
mountpoint = "/var" | |||
size = 2147483648 | |||
minsize = 2147483648 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume there is no risk here that there are "wrong" blueprint tomls out there that we would break with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those cases are handled by the custom unmarshaller in osbuild-composer before being sent through to the code here in images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the filesystem customization, the toml tags clearly sets the
MinSize
field's key tominsize
, this is also reflected inbootc-image-builder
docs. However, the custom unmarshallers are actually wrong, they still refer to the oldsize
name (see #825).This PR fixes the unmarshallers, and adds more test coverage.