Skip to content

Commit

Permalink
Merge pull request #412 from traylenator/startlimit
Browse files Browse the repository at this point in the history
Support `StartLimitIntervalSec` and  `StartLimitBurst`
  • Loading branch information
traylenator authored Feb 13, 2024
2 parents 18ac058 + 3628f31 commit 92b421e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,8 @@ Struct[{
Optional['ConditionPathExists'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsDirectory'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsMountPoint'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['StartLimitIntervalSec'] => String[1],
Optional['StartLimitBurst'] => Integer[1],
}]
```

5 changes: 5 additions & 0 deletions spec/type_aliases/systemd_unit_unit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,9 @@
it { is_expected.not_to allow_value({ 'RequiresMountsFor' => 'not/an/absolute/path' }) }
it { is_expected.not_to allow_value({ 'RequiresMountsFor' => ['not/a/path'] }) }
it { is_expected.not_to allow_value({ 'RequiresMountsFor' => [] }) }

it { is_expected.to allow_value({ 'StartLimitIntervalSec' => '12 hours' }) }
it { is_expected.to allow_value({ 'StartLimitIntervalSec' => 'infinity' }) }
it { is_expected.to allow_value({ 'StartLimitBurst' => 5 }) }
it { is_expected.not_to allow_value({ 'StartLimitBurst' => '5' }) }
end
2 changes: 2 additions & 0 deletions types/unit/unit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@
Optional['ConditionPathExists'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsDirectory'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsMountPoint'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['StartLimitIntervalSec'] => String[1],
Optional['StartLimitBurst'] => Integer[1],
}
]

0 comments on commit 92b421e

Please sign in to comment.