Skip to content

Commit 3317560

Browse files
authored
Merge pull request #472 from traylenator/swapmaxpercent
Allow `MemorySwapMax` be specified as a percentage
2 parents aea425a + c3965db commit 3317560

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2888,7 +2888,7 @@ Struct[{
28882888
Optional['MemoryHigh'] => Systemd::Unit::AmountOrPercent,
28892889
Optional['MemoryMax'] => Systemd::Unit::AmountOrPercent,
28902890
Optional['MemoryLimit'] => Systemd::Unit::Amount,
2891-
Optional['MemorySwapMax'] => Systemd::Unit::Amount,
2891+
Optional['MemorySwapMax'] => Systemd::Unit::AmountOrPercent,
28922892
Optional['TasksAccounting'] => Boolean,
28932893
Optional['TasksMax'] => Systemd::Unit::AmountOrPercent,
28942894
Optional['IOAccounting'] => Boolean,

spec/type_aliases/systemd_unit_service_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
)
104104
}
105105

106+
it { is_expected.to allow_value({ 'MemorySwapMax' => '80%' }) }
107+
106108
it { is_expected.not_to allow_value({ 'CPUQuota' => 50 }) }
107109
it { is_expected.not_to allow_value({ 'CPUQuota' => '0%' }) }
108110
it { is_expected.not_to allow_value({ 'MemoryHigh' => '1Y' }) }

types/unit/service.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
Optional['MemoryHigh'] => Systemd::Unit::AmountOrPercent,
5858
Optional['MemoryMax'] => Systemd::Unit::AmountOrPercent,
5959
Optional['MemoryLimit'] => Systemd::Unit::Amount,
60-
Optional['MemorySwapMax'] => Systemd::Unit::Amount,
60+
Optional['MemorySwapMax'] => Systemd::Unit::AmountOrPercent,
6161
Optional['TasksAccounting'] => Boolean,
6262
Optional['TasksMax'] => Systemd::Unit::AmountOrPercent,
6363
Optional['IOAccounting'] => Boolean,

0 commit comments

Comments
 (0)