Skip to content

Commit

Permalink
Fixes #34298 - support KEEP_CHANGELOG_LIMIT option
Browse files Browse the repository at this point in the history
  • Loading branch information
wbclark committed Jan 25, 2022
1 parent d347abd commit 739d0f4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions manifests/plugin/rpm.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# @summary Pulp RPM plugin
# @param use_pulp2_content_route
# Whether to redirect the legacy (Pulp 2) URLs to the content server
#
# @param keep_changelog_limit
# Pulpcore's KEEP_CHANGELOG_LIMIT setting. Uses Pulpcore's default when
# undefined. Increasing this limit will cause pulpcore workers to use more
# memory when more changelogs are available in the repo metadata.
class pulpcore::plugin::rpm (
Boolean $use_pulp2_content_route = false,
Optional[Integer[0]] $keep_changelog_limit = undef,
) {
if $use_pulp2_content_route {
$context = {
Expand All @@ -28,8 +34,15 @@
$content = undef
}

if $keep_changelog_limit {
$rpm_plugin_config = "KEEP_CHANGELOG_LIMIT = ${keep_changelog_limit}"
} else {
$rpm_plugin_config = undef
}

pulpcore::plugin { 'rpm':
http_content => $content,
https_content => $content,
config => $rpm_plugin_config,
}
}
11 changes: 11 additions & 0 deletions spec/classes/plugin_rpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
is_expected.to contain_pulpcore__plugin('rpm')
.that_subscribes_to('Class[Pulpcore::Install]')
.that_notifies(['Class[Pulpcore::Database]', 'Class[Pulpcore::Service]'])
is_expected.not_to contain_concat__fragment('plugin-rpm')
end

context 'with keep_changelog_limit' do
let(:params) { { keep_changelog_limit: 20 } }

it 'configures pulpcore with KEEP_CHANGELOG_LIMIT' do
is_expected.to compile.with_all_deps
is_expected.to contain_concat__fragment('plugin-rpm')
.with_content("\n# rpm plugin settings\nKEEP_CHANGELOG_LIMIT = 20")
end
end

context 'with pulp2 content route' do
Expand Down

0 comments on commit 739d0f4

Please sign in to comment.