Skip to content

service: Fix wrong check when searching or creating a storage device#3322

Merged
ancorgs merged 2 commits intoagama-project:masterfrom
ancorgs:create_if_not_found
Mar 23, 2026
Merged

service: Fix wrong check when searching or creating a storage device#3322
ancorgs merged 2 commits intoagama-project:masterfrom
ancorgs:create_if_not_found

Conversation

@ancorgs
Copy link
Copy Markdown
Contributor

@ancorgs ancorgs commented Mar 23, 2026

Problem

As reported at #2985.

When searching for a device with the setting { "ifNotFound": "create" }, Agama was reporting an error if the device was not found.

Actually, the mechanism to create the missing device is in place, but the overzealous check was causing the rest of the process to be aborted so it was not even attempted.

Solution

This fixes #2985 by improving the check. Now it takes the case of { "ifNotFound": "create" } into account.

Testing

  • Added a new unit test to the config checker
  • Added a couple of regression test to prove the devices can actually be created if not found

In fact, this PR is a small fix... with several lines of extra tests to verify.

@ancorgs ancorgs force-pushed the create_if_not_found branch from 22b66f2 to 7a5a192 Compare March 23, 2026 14:54
Copy link
Copy Markdown
Contributor

@joseivanlopez joseivanlopez left a comment

Choose a reason for hiding this comment

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

Looks good. Please, add a changelog entry.

Copy link
Copy Markdown
Contributor

@joseivanlopez joseivanlopez left a comment

Choose a reason for hiding this comment

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

LGTM

@ancorgs ancorgs merged commit c14f986 into agama-project:master Mar 23, 2026
5 checks passed
@imobachgs imobachgs mentioned this pull request Apr 14, 2026
imobachgs added a commit that referenced this pull request Apr 14, 2026
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.

Partition search - creation if not found doesn't seem to work

2 participants