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

lvol: Fix pct of origin #7053

Merged
merged 4 commits into from
Aug 12, 2023

Conversation

swapdisk
Copy link
Contributor

@swapdisk swapdisk commented Aug 1, 2023

SUMMARY

The size parameter of the lvol module did not support percentage of origin size specification when creating a snapshot volume. This is valid according to lvcreate(8). This PR addresses the issue.

I increased the size of the loop devices in the test playbook to accommodate creating test snapshot LVs. The modified tests worked for me locally. Fingers crossed for the CI workflow.

Fixes #1630

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lvol module

ADDITIONAL INFORMATION

My first PR to the community.general collection. Kindly guide me if I've done anything wrong. Thanks!

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug integration tests/integration module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Aug 1, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-6 backport-7 Automatically create a backport for the stable-7 branch labels Aug 2, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I've added some first comments.

changelogs/fragments/lvol-pct-of-origin.yml Outdated Show resolved Hide resolved
plugins/modules/lvol.py Outdated Show resolved Hide resolved
@felixfontein
Copy link
Collaborator

The failing VM test should get fixed by #7055.

Co-authored-by: Felix Fontein <felix@fontein.de>
@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Aug 2, 2023
@felixfontein felixfontein changed the title Fix pct of origin lvol: Fix pct of origin Aug 7, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

As far as I can judge this this looks good. The code change should not break anything that works right now. I will merge this this weekend if nobody objects.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Aug 12, 2023
@felixfontein felixfontein merged commit a0c67a8 into ansible-collections:main Aug 12, 2023
151 checks passed
@patchback
Copy link

patchback bot commented Aug 12, 2023

Backport to stable-6: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply a0c67a8 on top of patchback/backports/stable-6/a0c67a88949fa7ca204740d84bfc37e950b0f3b3/pr-7053

Backporting merged PR #7053 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/community.general.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-6/a0c67a88949fa7ca204740d84bfc37e950b0f3b3/pr-7053 upstream/stable-6
  4. Now, cherry-pick PR lvol: Fix pct of origin #7053 contents into that branch:
    $ git cherry-pick -x a0c67a88949fa7ca204740d84bfc37e950b0f3b3
    If it'll yell at you with something like fatal: Commit a0c67a88949fa7ca204740d84bfc37e950b0f3b3 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x a0c67a88949fa7ca204740d84bfc37e950b0f3b3
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR lvol: Fix pct of origin #7053 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-6/a0c67a88949fa7ca204740d84bfc37e950b0f3b3/pr-7053
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link

patchback bot commented Aug 12, 2023

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/a0c67a88949fa7ca204740d84bfc37e950b0f3b3/pr-7053

Backported as #7097

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 12, 2023
* add support for percentage of origin size for creating snapshot volumes

* add changelog fragment

* add pull request link

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix what's not idempotent

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit a0c67a8)
felixfontein pushed a commit that referenced this pull request Aug 12, 2023
lvol: Fix pct of origin (#7053)

* add support for percentage of origin size for creating snapshot volumes

* add changelog fragment

* add pull request link

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix what's not idempotent

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit a0c67a8)

Co-authored-by: Bob Mader <bmader@redhat.com>
@swapdisk swapdisk deleted the fix_pct_of_origin branch August 14, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7 Automatically create a backport for the stable-7 branch bug This issue/PR relates to a bug has_issue integration tests/integration module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lvol - lvcreate snapshot "**%ORIGIN" fails
3 participants