Skip to content

Commit

Permalink
Merge pull request #472 from traylenator/swapmaxpercent
Browse files Browse the repository at this point in the history
Allow `MemorySwapMax` be specified as a percentage
  • Loading branch information
traylenator authored Jul 4, 2024
2 parents aea425a + c3965db commit 3317560
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2888,7 +2888,7 @@ Struct[{
Optional['MemoryHigh'] => Systemd::Unit::AmountOrPercent,
Optional['MemoryMax'] => Systemd::Unit::AmountOrPercent,
Optional['MemoryLimit'] => Systemd::Unit::Amount,
Optional['MemorySwapMax'] => Systemd::Unit::Amount,
Optional['MemorySwapMax'] => Systemd::Unit::AmountOrPercent,
Optional['TasksAccounting'] => Boolean,
Optional['TasksMax'] => Systemd::Unit::AmountOrPercent,
Optional['IOAccounting'] => Boolean,
Expand Down
2 changes: 2 additions & 0 deletions spec/type_aliases/systemd_unit_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
)
}

it { is_expected.to allow_value({ 'MemorySwapMax' => '80%' }) }

it { is_expected.not_to allow_value({ 'CPUQuota' => 50 }) }
it { is_expected.not_to allow_value({ 'CPUQuota' => '0%' }) }
it { is_expected.not_to allow_value({ 'MemoryHigh' => '1Y' }) }
Expand Down
2 changes: 1 addition & 1 deletion types/unit/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
Optional['MemoryHigh'] => Systemd::Unit::AmountOrPercent,
Optional['MemoryMax'] => Systemd::Unit::AmountOrPercent,
Optional['MemoryLimit'] => Systemd::Unit::Amount,
Optional['MemorySwapMax'] => Systemd::Unit::Amount,
Optional['MemorySwapMax'] => Systemd::Unit::AmountOrPercent,
Optional['TasksAccounting'] => Boolean,
Optional['TasksMax'] => Systemd::Unit::AmountOrPercent,
Optional['IOAccounting'] => Boolean,
Expand Down

0 comments on commit 3317560

Please sign in to comment.