Skip to content

Commit c239bc7

Browse files
committed
Make versions match SemVer pattern
All PE version downloads need to match the x.y.z format. This commit changes the type specifier to require this format. This is especially useful to help guide people to the right parameters if they specify a version like "2022.4" instead of "2022.4.0".
1 parent 7b21708 commit c239bc7

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

plans/install.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
# Common Configuration
2828
String $console_password,
29-
String $version = '2019.8.8',
29+
Peadm::Pe_version $version = '2019.8.8',
3030
Optional[Array[String]] $dns_alt_names = undef,
3131
Optional[String] $compiler_pool_address = undef,
3232
Optional[String] $internal_compiler_a_pool_address = undef,

plans/subplans/install.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# Common Configuration
3636
String $console_password,
37-
String $version = '2019.8.5',
37+
Peadm::Pe_version $version,
3838
Array[String] $dns_alt_names = [ ],
3939
Hash $pe_conf_data = { },
4040

plans/upgrade.pp

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
Optional[Peadm::SingleTargetSpec] $replica_postgresql_host = undef,
2626

2727
# Common Configuration
28-
String $version,
29-
Optional[String] $compiler_pool_address = undef,
30-
Optional[String] $internal_compiler_a_pool_address = undef,
31-
Optional[String] $internal_compiler_b_pool_address = undef,
28+
Peadm::Pe_version $version,
29+
Optional[String] $compiler_pool_address = undef,
30+
Optional[String] $internal_compiler_a_pool_address = undef,
31+
Optional[String] $internal_compiler_b_pool_address = undef,
3232

3333
# Other
3434
Optional[String] $token_file = undef,

spec/plans/subplans/install_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737
##########
3838

3939
params = {
40-
'primary_host' => 'primary',
40+
'primary_host' => 'primary',
4141
'console_password' => 'puppetlabs',
42+
'version' => '2019.8.10',
4243
}
4344

4445
expect(run_plan('peadm::subplans::install', params)).to be_ok

types/pe_version.pp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type Peadm::Pe_version = Pattern[/^\d+\.\d+\.\d+(-.+)?$/]

0 commit comments

Comments
 (0)