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

feature(storage): config support for current size #1617

Merged

Conversation

joseivanlopez
Copy link
Contributor

@joseivanlopez joseivanlopez commented Sep 18, 2024

Add support to the storage config for resizing a partition using its current size as minimum or maximim limit, see auto_storage.md document.

For growing a partition as much as possible:

{
  "partitions": [
    {
      "search": "/dev/vda1",
      "size": {
        "min": "current"
      }
    }
  ]
}

For shrinking a partition as much as possible:

{
  "partitions": [
    {
      "search": "/dev/vda1",
      "size": {
        "min": 0,
        "max": "current"
      }
    }
  ]
}

For omittied size, the default size indicated by the product is used for a new partition. If the partition already exists (has a search), then the current device size is used as default (i.e., the device is not resized at all).

@coveralls
Copy link

coveralls commented Sep 18, 2024

Coverage Status

coverage: 71.986%. remained the same
when pulling aa00a4f on joseivanlopez:storage-size-current
into bb4a557 on openSUSE:master.

@joseivanlopez joseivanlopez force-pushed the storage-size-current branch 5 times, most recently from 71b0df3 to d3ee397 Compare September 19, 2024 15:18
@joseivanlopez joseivanlopez force-pushed the storage-size-current branch 5 times, most recently from 4f06d2f to db9d97c Compare September 23, 2024 14:40
- Do not remove configs if a search is not found.
- Introduce ConfigSolver class.
- Extend ConfigChecker to generate search issues.
@joseivanlopez joseivanlopez marked this pull request as ready for review September 23, 2024 14:57
- New config solver for sizes (current, defaults, etc).
- Move logic related to fallback sizes to ConfigBuilder.
Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

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

LGTM

@joseivanlopez joseivanlopez merged commit 1e736e3 into agama-project:master Sep 24, 2024
3 of 4 checks passed
ancorgs added a commit that referenced this pull request Sep 24, 2024
#1617 introduced some changes on
the acceptable values for sizes and how they are managed. To be precise,
it affects the special values like "default" (that is not longer
considered an option) and "current".

It also changes the behavior when the size is omitted for a partition or
logical volume.

The current PR updates the documentation to reflect the changes
introduced at the mentioned pull request.
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.

3 participants