Skip to content
Draft
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
8 changes: 8 additions & 0 deletions lib/smart_proxy_pulp_plugin/pulpcore_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module PulpProxy
class PulpcorePlugin < ::Proxy::Plugin
plugin "pulpcore", ::PulpProxy::VERSION
default_settings :pulp_url => 'https://localhost',
:container_registry_url => false,
:content_app_url => 'https://localhost:24816/',
:mirror => false,
:client_authentication => ['password', 'client_certificate']
Expand All @@ -15,9 +16,16 @@ class PulpcorePlugin < ::Proxy::Plugin
validate :content_app_url, :url => true
validate :client_authentication, :include => AUTH_TYPES

load_programmable_settings do |setting|
if settings[:container_registry_url] == true
settings[:container_registry_url] = URI.join(settings[:pulp_url], '/pulpcore_registry')
end
end

expose_setting :pulp_url
expose_setting :mirror
expose_setting :content_app_url
expose_setting :container_registry_url
expose_setting :username
expose_setting :password
expose_setting :client_authentication
Expand Down
20 changes: 17 additions & 3 deletions settings.d/pulpcore.yml.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
---
:enabled: true
#:pulp_url: https://localhost/
#:content_app_url: https://localhost:24816/

# The URL serving the pulpcore-api without any path
#:pulp_url: https://localhost:24817/
# Only set this if the container registry is present. This points to pulpcore-api.
# Can also be set to true in which case it'll be derived from pulp_url
#:container_registry_url: https://localhost:24817/pulpcore_registry
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the part about pulpcore-api is incorrect. The registry endpoint is present on the content app.

Can you have the registry end point running at a different host:port combo that the content app? @jlsherrill

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you certain? I based this on https://github.com/theforeman/puppet-pulpcore/blob/7a5543b1a47de8d76a1cad1fb76e12db7bbf8e45/manifests/plugin/container.pp#L9-L21.

Now that look I see we also have an Ansible Galaxy endpoint:
https://github.com/theforeman/puppet-pulpcore/blob/7a5543b1a47de8d76a1cad1fb76e12db7bbf8e45/manifests/plugin/ansible.pp#L6-L16

Perhaps that should be exposed as well so Katello doesn't have to guess. @jlsherrill is that used anywhere within Katello?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This https://github.com/Katello/katello/pull/9450/files#diff-bda566f2c5501c43867744c439cd22a7686af2940052749f3414e7b10c51308cR29-R30 constructs it based on the content app URL. I guess I don't right know which is which right at the moment. Save us Obi-Wan

# The content URL. This points to pulpcore-content
#:content_app_url: https://localhost:24816/pulp/content

# Expose which client authentication works. At least one is needed.
# client_certificate and client_certificate_admin_only are mutually exclusive
# Possible values
#:client_authentication: ['password', 'client_certificate', 'client_certificate_admin_only']

# Not needed in most production setups
#:username: admin
#:password: password

# False implies it's a primary. There should only be one primary in your infra
#:mirror: false
#:client_authentication: ['password', 'client_certificate']