Skip to content

Commit

Permalink
Move ManagerRefresh to InventoryRefresh
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Sep 7, 2018
1 parent dcc32f3 commit 5565f37
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def parse_target_from_notice(notice)

ems_ref = parse_notice_pod_ems_ref(object)

ManagerRefresh::Target.new(
InventoryRefresh::Target.new(
:manager => ems,
:association => :container_groups,
:manager_ref => ems_ref,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def persister_inv_to_persister(persister, inventory, options)
get_container_images_graph
get_container_image_registries_graph

# Returning Persister triggers ManagerRefresh::SaveInventory code path.
# Returning Persister triggers InventoryRefresh::SaveInventory code path.
persister
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def preprocess_targets

if sub_ems_targets.present? && refresher_options.inventory_object_refresh
# We can disable targeted refresh with a setting, then we will just do full ems refresh on any event
ems_event_collection = ManagerRefresh::TargetCollection.new(:targets => sub_ems_targets,
ems_event_collection = InventoryRefresh::TargetCollection.new(:targets => sub_ems_targets,
:manager_id => ems_id)
# Before full EMS refresh, we want to refresh any targets found
all_targets << ems_event_collection
Expand All @@ -31,7 +31,7 @@ def collect_inventory_for_targets(ems, targets)
# TODO(lsmola) we need to move to common Graph Refresh architecture with Inventory Builder having Collector,
# Parser and Persister
targets.map do |target|
inventory = if target.kind_of?(ManagerRefresh::TargetCollection)
inventory = if target.kind_of?(InventoryRefresh::TargetCollection)
target_collection_collector_class.new(ems, target).inventory(all_entities)
else
collect_full_inventory(ems)
Expand All @@ -45,7 +45,7 @@ def parse_targeted_inventory(ems, target, inventory)
# TODO(lsmola) we need to move to common Graph Refresh architecture with Inventory Builder having Collector,
# Parser and Persister
if refresher_options.inventory_object_refresh
if target.kind_of?(ManagerRefresh::TargetCollection)
if target.kind_of?(InventoryRefresh::TargetCollection)
refresh_parser_class.target_collection_inv_to_persister(ems, inventory, refresher_options)
else
refresh_parser_class.ems_inv_to_persister(ems, inventory, refresher_options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def queue_target!(watch_data_path)
# Below, a code from ManageIQ::Providers::Kubernetes::ContainerManager::InventoryCollectorWorker::Runner#do_work
ems_ref = parse_notice_pod_ems_ref(notice['object'])

target = ManagerRefresh::Target.new(
target = InventoryRefresh::Target.new(
:manager => @ems,
:association => :container_groups,
:manager_ref => ems_ref,
Expand Down

0 comments on commit 5565f37

Please sign in to comment.