-
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
Graph refresh: links between entities #52
Conversation
return nil if hash.nil? | ||
# Subtle: we can match replicators by project name - instead of project ems_ref - | ||
# because when indexed their :container_project a itself lazy_find :by_name, | ||
# so its .to_s is the project name. |
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.
@Ladas @agrare This troubles me ^^
Even without secondary refs, the indirection when manager_ref contains links to other entities, is magic when it works but scared me a bit...
Here I'd prefer to keep :namespace
in the replicator data, and explicitly use it in indexes. I need to blacklist it so ActiveRecord .create doesn't complain. When I tried this before, InventoryCollection didn't let me blacklist things that are parts of manager_ref — can we relax this (or not enforce it for secondary indexes)?
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.
Yeah we can relax the condition for the secondary indexes. It make sense only for primary index, otherwise you would not be able to identify the same record later.
Yeah having lazy_link as part of the index is funky :-)
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.
cool, switched to index by blacklisted :namespace & name.
0bda567
to
b031e16
Compare
This now passes referher specs, except tag mapping :-)
|
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.
👍
@cben can you squash the commits? I think we're ready for merge. |
Checked commit cben@79d0212 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/manageiq/providers/kubernetes/container_manager/refresh_parser.rb
|
Squashed & updated PR description. |
37396e9
to
074ab01
Compare
Now kubernetes graph refresh passes full refresher tests! - Except tagging by labels which is skipped. A few things starting with _ indicate still missing functionality that is not covered by refresher_spec, will add tests later. Mostly using lazy_find by secodary indexes on name or (namespace, name). - Still using data_index for images & registries. - Used a local hash similar to data_index for endpoint/service matching.
@simon3z ready for merge?
|
Followup to #30, implements most entity links in get_*_graph.
Now kubernetes graph refresh passes full refresher tests!
A few things starting with _ indicate still missing functionality that is not covered by refresher_spec, will add tests later.
Mostly using
lazy_find
by secodary indexes on name or (namespace, name).(enabled by ManageIQ/manageiq#15447)
@data_index
for images & registries.