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

blueprint: fix DiskCustomization.MinSize with existing pattern #1055

Closed
wants to merge 2 commits into from

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Nov 22, 2024

This commit fixes the issue that minsize cannot be a string
by using the existing pattern.

See #1049 for alternative
ideas.


The disk customizations min-size setting is not accepting strings
or strings with units. This commit adds a failing test that will
validate the fix.

[this was found as part of the work in bib, https://github.com/osbuild/bootc-image-builder/pull/721]

achilleas-k
achilleas-k previously approved these changes Nov 22, 2024
mvo5 added 2 commits November 22, 2024 12:30
The disk customizations min-size setting is not accepting strings
or strings with units. This commit adds a failing test that will
validate the fix.
This commit fixes the issue that minsize cannot be a string
by using the existing pattern.

See osbuild#1049 for alternative
ideas.
@@ -18,6 +18,27 @@ type DiskCustomization struct {
Partitions []PartitionCustomization `json:"partitions,omitempty" toml:"partitions,omitempty"`
}

func (dc *DiskCustomization) UnmarshalJSON(data []byte) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh, this lacks the toml unmarshaler :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs some error tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably can close this in favor of #1057 which archives this with less code (but some boilerplate).

mvo5 added a commit to mvo5/images that referenced this pull request Nov 22, 2024
This commit fixes the issue that minsize cannot be a string
by using the existing pattern.

See osbuild#1055 for the alternative
approach.
@mvo5 mvo5 marked this pull request as draft November 22, 2024 11:58
@mvo5
Copy link
Contributor Author

mvo5 commented Nov 22, 2024

Moving to draft as this can most likely get closed in favor of #1057

@mvo5
Copy link
Contributor Author

mvo5 commented Nov 22, 2024

Closing in favor of #1057

@mvo5 mvo5 closed this Nov 22, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 22, 2024
This commit fixes the issue that minsize cannot be a string
by using the existing pattern.

See #1055 for the alternative
approach.
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