forked from Katello/katello
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #27418 - Support docker pull with pulp3
This supports docker pull with pulp3. Crane (pulp2) is still supported and the registry URL is dynamically determined based on the support for Docker blobs. Previously, the RegistryResource class would run code when loaded, setting up the inherited class variables. This commit moves this and the new logic to a class method. Since there are now backend calls (to check for pulp3) to set up the class variables, it seems like this should be a more deliberate action. This also makes testing much easier. I'm open to other suggestions on how to handle the class inheritance and the class variables. To test: - Modify foreman/config/settings.plugins.d/katello.yaml, adding the pulp_registry_url ```yaml :container_image_registry: :crane_url: https://localhost:5000 :pulp_registry_url: http://localhost:24816 :registry_ca_cert_file: /etc/pki/katello/certs/katello-default-ca.crt ``` - Set up docker on pulp3 box. You will need an up-to-date box since pulp/pulp_docker#391 was merged - Sync repos, you can use https://cloud.docker.com/u/jomitsch/repository/docker/jomitsch/workflow-test for a small one. - docker login $HOSTNAME - docker pull $HOSTNAME/default_organization-docker-workflow_test (check name in docker repo details) - docker pull should be successful It's worth trying out some other repos or registries (like quay.io) and also we should ensure pulp2 functionality is not expected There will be installer changes to come that will update both dev and prod's katello.yml, these will need to be merged along with this PR I also updated the rubocop_todo as it was throwing warnings for duplicate entries.
- Loading branch information
John Mitsch
committed
Aug 23, 2019
1 parent
257195c
commit 03fcc90
Showing
6 changed files
with
91 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'katello_test_helper' | ||
|
||
module Katello | ||
module Resources | ||
class RegistryTest < ActiveSupport::TestCase | ||
before do | ||
@crane_url = "https://localhost:5000" | ||
SETTINGS[:katello][:container_image_registry] = { | ||
crane_url: @crane_url | ||
} | ||
end | ||
|
||
def test_pulp3_registry_url | ||
pulp_master = FactoryBot.create(:smart_proxy, :default_smart_proxy, :with_pulp3) | ||
::SmartProxy.expects(:pulp_master).at_least_once.returns(pulp_master) | ||
assert_equal Registry::RegistryResource.load_class.site, 'http://localhost:24816' | ||
end | ||
|
||
def test_crane_registry_url | ||
assert_equal Registry::RegistryResource.load_class.site, @crane_url | ||
end | ||
end | ||
end | ||
end |