Project

General

Profile

Revision f02a9ce2

Added by Sebastian Gräßl over 5 years ago

Fixes #18733 - Prevent fallback to Docker Hub on registry search

When searching for an external registry the search would show
results from Docker Hub due to it searching via the compute
resource.

By using a registry parameter to indicate which search tab is
active this gets prevented on the backend as well as on the
client by not searching when no registry is selected.

View differences:

test/test_plugin_helper.rb
12 12
# Add plugin to FactoryGirl's paths
13 13
FactoryGirl.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
14 14
FactoryGirl.reload
15

  
16
def stub_image_existance(exists = true)
17
  Docker::Image.any_instance.stubs(:exist?).returns(exists)
18
  ForemanDocker::ImageSearch.any_instance.stubs(:available?).returns(exists)
19
end
20

  
21
def stub_registry_api
22
  Service::RegistryApi.any_instance.stubs(:get).returns({'results' => []})
23
  Docker::Image.stubs(:all).returns([])
24
end
25

  

Also available in: Unified diff