Skip to content

Commit

Permalink
Merge pull request #11 from cben/config_unused_images
Browse files Browse the repository at this point in the history
Option needed for new ems_refresh.openshift.store_unused_images setting
  • Loading branch information
simon3z authored Aug 29, 2017
2 parents e2e6694 + 004437c commit 0046549
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,8 @@ def parse_container_state(state_hash)
res
end

def parse_container_image(image, imageID)
# may return nil if store_new_images = false
def parse_container_image(image, imageID, store_new_images: true)
container_image, container_image_registry = parse_image_name(image, imageID)
host_port = nil

Expand All @@ -1124,6 +1125,7 @@ def parse_container_image(image, imageID)
:container_image, :by_digest, container_image_identity)

if stored_container_image.nil?
return nil unless store_new_images
@data_index.store_path(
:container_image, :by_digest,
container_image_identity, container_image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,15 @@
expect(first_obj).to be(second_obj)
end
end

it "returns existing image or nil with store_new_images=false" do
obj1 = parser.parse_container_image(shared_image_without_host, shared_ref)
obj2 = parser.parse_container_image(shared_image_without_host, shared_ref, :store_new_images => false)
obj3 = parser.parse_container_image(shared_image_without_host, unique_ref, :store_new_images => false)
expect(obj1).not_to be nil
expect(obj2).to be obj2
expect(obj3).to be nil
end
end

describe "cross_link_node" do
Expand Down

0 comments on commit 0046549

Please sign in to comment.