Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support /pulp/deb proxying #145

Merged
merged 1 commit into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion manifests/plugin/deb.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# @summary Pulp Deb plugin
class pulpcore::plugin::deb {
# @param use_pulp2_content_route Whether to redirect the legacy (Pulp 2) URL, /pulp/deb/, to the content server
class pulpcore::plugin::deb (
Boolean $use_pulp2_content_route = false,
) {
if $use_pulp2_content_route {
$context = {
'directories' => [
{
'provider' => 'location',
'path' => '/pulp/deb',
'proxy_pass' => [
{
'url' => $pulpcore::apache::content_url,
},
],
'request_headers' => [
'unset X-CLIENT-CERT',
'set X-CLIENT-CERT "%{SSL_CLIENT_CERT}s" env=SSL_CLIENT_CERT',
],
},
],
}
$content = epp('pulpcore/apache-fragment.epp', $context)
} else {
$content = undef
}

pulpcore::plugin { 'deb':
http_content => $content,
https_content => $content,
}
}
13 changes: 13 additions & 0 deletions spec/classes/plugin_deb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_pulpcore__plugin('deb') }
it { is_expected.to contain_package('python3-pulp-deb') }
it { is_expected.not_to contain_apache__vhost__fragment('pulpcore-http-plugin-deb') }
it { is_expected.not_to contain_apache__vhost__fragment('pulpcore-https-plugin-deb') }

context 'with pulpcore' do
let(:pre_condition) { 'include pulpcore' }
Expand All @@ -18,6 +20,17 @@
.that_subscribes_to('Class[Pulpcore::Install]')
.that_notifies(['Class[Pulpcore::Database]', 'Class[Pulpcore::Service]'])
end

context 'with pulp2 content route' do
let(:params) { { use_pulp2_content_route: true } }

it 'contains the Apache fragment' do
is_expected.to compile.with_all_deps
is_expected.to contain_pulpcore__apache__fragment('plugin-deb')
is_expected.to contain_apache__vhost__fragment('pulpcore-http-plugin-deb')
is_expected.to contain_apache__vhost__fragment('pulpcore-https-plugin-deb')
end
end
end
end
end
Expand Down