Skip to content

Commit

Permalink
Fixes #37959 - Allow optimized sync for ansible collections (#11284)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 authored Feb 4, 2025
1 parent 571efcb commit 62f5a5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions app/services/katello/pulp3/repository/ansible_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def partial_repo_path
"/pulp_ansible/galaxy/#{repo.relative_path}/api/"
end

def sync_url_params(sync_options)
params = super
params[:optimize] = sync_options[:optimize] if sync_options.key?(:optimize)
params
end

def mirror_remote_options
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def setup
def test_sync
@repo_mirror.stubs(:remote_href).returns("remote_href")
@repo_mirror.stubs(:repository_href).returns("repository_href")
sync_url = @repo_service.api.repository_sync_url_class.new(remote: "remote_href", mirror: true)
PulpAnsibleClient::AnsibleRepositorySyncURL.expects(:new).with({ remote: "remote_href", mirror: true }).once.returns(sync_url)
sync_url = @repo_service.api.repository_sync_url_class.new(remote: "remote_href", mirror: true, optimize: true)
PulpAnsibleClient::AnsibleRepositorySyncURL.expects(:new).with({ remote: "remote_href", mirror: true, optimize: true }).once.returns(sync_url)
PulpAnsibleClient::RepositoriesAnsibleApi.any_instance.expects(:sync).once.with("repository_href", sync_url)
@repo_mirror.sync(optimize: "test", skip_types: "another test")
@repo_mirror.sync(optimize: true, skip_types: "another test")
end

def test_refresh_distributions_update_dist
Expand Down

0 comments on commit 62f5a5c

Please sign in to comment.