Skip to content

Commit

Permalink
fixes #18993 - Set depth for ostree distributor
Browse files Browse the repository at this point in the history
Prior to this commit one could only set depth for ostree importer.
This one enables one to set it for the distributor also.
This will enable pulp to selectively publish  what its synced from
upstream feed.
  • Loading branch information
parthaa authored and jlsherrill committed Mar 23, 2017
1 parent 27b106f commit f87181a
Show file tree
Hide file tree
Showing 12 changed files with 647 additions and 204 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Exposing Pulp's juiciest parts. http://www.pulpproject.org/

Latest Live Tested Version: **pulp-server-2.11.0-1.el7.noarch**
Latest Live Tested Version: **pulp-server-2.12.1-1.el7.noarch**

Current stable Runcible: https://github.com/Katello/runcible/tree/0.3

Expand Down
2 changes: 1 addition & 1 deletion lib/runcible/models/ostree_distributor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Runcible
module Models
class OstreeDistributor < Distributor
attr_accessor 'ostree_publish_directory', 'relative_path'
attr_accessor 'ostree_publish_directory', 'relative_path', 'depth'

def initialize(params = {})
super(params)
Expand Down
11 changes: 7 additions & 4 deletions test/extensions/ostree_repository_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,20 @@ def test_create_with_importer_and_distributors
end

def test_create_with_importer_and_distributors_objects
distributors = [Runcible::Models::OstreeDistributor.new(:id => '123')]
distributor_depth = -1
distributors = [Runcible::Models::OstreeDistributor.new(:id => '123', :depth => distributor_depth)]
importer = Runcible::Models::OstreeImporter.new
depth = -1
importer.depth = depth
importer_depth = 4
importer.depth = importer_depth
response = @extension.create_with_importer_and_distributors(RepositorySupport.repo_id, importer, distributors)
assert_equal 201, response.code

response = @extension.retrieve(RepositorySupport.repo_id, :details => true)
assert_equal RepositorySupport.repo_id, response['id']
assert_equal 'ostree_web_importer', response['importers'].first['importer_type_id']
assert_equal depth, response['importers'].first['config']['depth']
assert_equal importer_depth, response['importers'].first['config']['depth']
assert_equal 'ostree_web_distributor', response['distributors'].first['distributor_type_id']
assert_equal distributor_depth, response['distributors'].first['config']['depth']
end
end

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f87181a

Please sign in to comment.