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

Support multiple pv's in lvm::volume #349

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

imp-
Copy link

@imp- imp- commented Sep 4, 2024

Summary

Before data types were introduced in commit 83efe16, it was possible to pass an array of physical volumes to the $lvm::volume::pv parameter.

This commit updates the type of the pv parameter to either support a single path or an array of paths.

Spec test updated accordingly.

Additional Context

We have a vg with 2 pv's:

PV         VG  Fmt  Attr PSize    PFree
/dev/sda1  myvg lvm2 a--  <100g       0
/dev/sdb1  myvg lvm2 a--  <100g       0

We create an lvm volume:

lvm::volume {
  'myvol':
    ensure => 'present',
    vg     => 'myvg',
    pv     => [
      '/dev/sda1',
      '/dev/sda2'
    ],
    fstype => 'xfs',
    size   => '10G';
}

When passing an array as pv, we get this error:

Lvm::Volume[myvol]: parameter 'pv' expects a Stdlib::Absolutepath = Variant[Stdlib::Windowspath = Pattern[/\A(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+)).*\z/], Stdlib::Unixpath = Pattern[/\A\/([^\n\/\0]+\/*)*\z/]] value, got Tuple

Related Issues (if any)

Commit 83efe16 was merged in #283

Checklist

  • [ x ] 🟢 Spec tests.
  • [ x ] Manually verified.

@imp- imp- requested review from bastelfreak and a team as code owners September 4, 2024 17:18
@CLAassistant
Copy link

CLAassistant commented Sep 4, 2024

CLA assistant check
All committers have signed the CLA.

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