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

fix: use stricter not found matching for lvm calls #892

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

jakobmoellerdev
Copy link
Contributor

fix #889 by changing the simple exitcode==5 check to a check that also verifies the returned stderr for the regex Volume group "(.*?)" not found|Failed to find logical volume "(.*?) so that errors that have exit code 5 but are not about the volume not being present do not cause TopoLVM to ignore the volume.

Since the lvm error handling got a bit too big for my taste I moved it into a separate file. I also added a test case to cover this regex style parsing.

@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner April 22, 2024 08:00
@jakobmoellerdev jakobmoellerdev force-pushed the lvm-error-detection branch 2 times, most recently from 8e9b8b3 to 1c8dc35 Compare April 22, 2024 08:29
@jakobmoellerdev jakobmoellerdev marked this pull request as draft April 22, 2024 08:53
@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review April 22, 2024 12:07
internal/lvmd/command/lvm_error.go Outdated Show resolved Hide resolved
internal/lvmd/command/lvm_error.go Outdated Show resolved Hide resolved
internal/lvmd/command/lvm_command_test.go Outdated Show resolved Hide resolved
Signed-off-by: Jakob Möller <jmoller@redhat.com>
@satoru-takeuchi satoru-takeuchi merged commit 639d3e3 into topolvm:main Apr 24, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

TopoLVM ignores lvremove errors
3 participants