-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add persistor with configurable saver strategy #73
Changes from 1 commit
07971aa
dd12ac7
9c21f48
3d20bac
a378d68
5bfd4f7
3a2e8bd
b2b618d
f22f947
8da447f
0af5990
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ module ManageIQ::Providers::Kubernetes | |
class ContainerManager::RefreshParser | ||
include Vmdb::Logging | ||
include ContainerManager::EntitiesMapping | ||
include ContainerManager::InventoryCollections | ||
|
||
def self.ems_inv_to_hashes(inventory, options = Config::Options.new) | ||
new(options).ems_inv_to_hashes(inventory, options) | ||
|
@@ -41,8 +40,12 @@ def ems_inv_to_hashes(inventory, _options = Config::Options.new) | |
@data | ||
end | ||
|
||
def persister_class | ||
ManageIQ::Providers::Kubernetes::Inventory::Persister::ContainerManager | ||
end | ||
|
||
def ems_inv_to_inv_collections(ems, inventory, options = Config::Options.new) | ||
persister = ManageIQ::Providers::Kubernetes::Inventory::Persister::ContainerManager.new(ems) | ||
persister = persister_class.new(ems) | ||
# TODO expose Persistor and use that | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ladas can you please explain this TODO? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just that we should replace the usage of @inv_collections, that we have in many files by the Persister object, that should be the interface There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh okay, was a little confused by the fact that here the todo is already done... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, we just need to fix all the other places. :-) |
||
@inv_collections = persister.collections | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://english.stackexchange.com/questions/206893/persister-or-persistor ? |
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A job for
Inventory.persister_class_for()
?(I'm actually happy as written — less magic to follow, but if you already have the magic lookup pattern in other places...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly, but the next step should be to expose persistor, instead of @inv_collections. So yeah, we could abstract that on the Inventory.