Skip to content

Commit

Permalink
add openshift_container_image class proccessing
Browse files Browse the repository at this point in the history
  • Loading branch information
Erez Freiberger committed Jun 13, 2017
1 parent 10ff45a commit 4f18efe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/manageiq/providers/openshift/container_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class ManageIQ::Providers::Openshift::ContainerManager < ManageIQ::Providers::Co
require_nested :RefreshWorker
require_nested :Refresher

has_many :openshift_container_images, :foreign_key => :ems_id, :dependent => :destroy

def self.ems_type
@ems_type ||= "openshift".freeze
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ def ems_inv_to_hashes(inventory, options = Config::Options.new)
end

def get_openshift_images(inventory)
inventory["image"].each { |img| parse_openshift_image(img) }
#inventory["image"].each { |img| parse_openshift_image(img) }
key = path_for_entity("openshift_image")
process_collection(inventory["image"], key) { |n| parse_openshift_image(n) }

# remove all openshift images from container_image list
@data[:container_images].delete_if { |ci| ci[:ems_ref] }
end

def get_builds(inventory)
Expand Down Expand Up @@ -175,6 +180,8 @@ def parse_openshift_image(openshift_image)
ref = "#{ContainerImage::DOCKER_PULLABLE_PREFIX}#{id}"
new_result = parse_container_image(id, ref)

new_result.merge!(:ems_ref => openshift_image.metadata.uid)

if openshift_image[:dockerImageManifest].present?
begin
json = JSON.parse(openshift_image[:dockerImageManifest])
Expand Down

0 comments on commit 4f18efe

Please sign in to comment.