-
Notifications
You must be signed in to change notification settings - Fork 107
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
[WIP] Using the new tag mapping for graph refresh #384
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
there are no @inv_collections[key]
first, you need to add the inv collection as @cben is doing it https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/162/files#diff-26f0b75803f05ef203ec5099294834dfR380
then the collection will be here as in
@collections
then call it e.g. as
persister.taggings_for_vm
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.
the inventory collections should be added here https://github.com/Ladas/manageiq-providers-amazon/blob/f9123d84236a66348c4bd05d499c74f94f6d7594/app/models/manageiq/providers/amazon/inventory/persister/cloud_manager.rb#L26
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.
btw.
NoMethodError: undefined method `[]' for nil:NilClass
is because @inv_collections are nilWe have @collections here, but we should not access it directly, that is why we call it as persister.collection_name
But unless you place it on @collections[collection.name] = InventoryCollection.new..., it will not be there
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.
I think the taggings collections can be added in app/models/manageiq/providers/amazon/inventory_collection_default/cloud_manager.rb similar to
vm_and_template_labels
(and called from https://github.com/Ladas/manageiq-providers-amazon/blob/f9123d84236a66348c4bd05d499c74f94f6d7594/app/models/manageiq/providers/amazon/inventory/persister/cloud_manager.rb#L5)playing with that now...
Also need to add
persistor.add_inventory_collection(@tag_mapper.tags_to_resolve_collection)
somewhere.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 yes, https://github.com/Ladas/manageiq-providers-amazon/blob/f9123d84236a66348c4bd05d499c74f94f6d7594/app/models/manageiq/providers/amazon/inventory/persister/cloud_manager.rb#L5 is a good place to have shared
Then we need to add it to cloud persitor:
https://github.com/Ladas/manageiq-providers-amazon/blob/f1a67bdf880ad381231e234962284c49717f5ea7/app/models/manageiq/providers/amazon/inventory/persister/cloud_manager.rb#L3
And also to target refresh persistor:
https://github.com/Ladas/manageiq-providers-amazon/blob/f1a67bdf880ad381231e234962284c49717f5ea7/app/models/manageiq/providers/amazon/inventory/persister/target_collection.rb#L2
For targeted refresh, we will need to add targeted_arel and parent_inventory_collections. Just enhanced arel condition we already have, it will look like https://github.com/Ladas/manageiq-providers-amazon/blob/f1a67bdf880ad381231e234962284c49717f5ea7/app/models/manageiq/providers/amazon/inventory_collection_default/cloud_manager.rb#L143 (so the condition will not have all Vms like in :arel, but only the limited set)
(targeted refresh specs share asserts with full refresh, so we should see it fail with missing tag)