Skip to content
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

Subclass IsoDatastore and transfer from core #621

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

nasark
Copy link
Member

@nasark nasark commented Nov 17, 2022

  • since iso datastores are only used by oVirt/RHV, we can move its model from core and into the provider plugin
  • iso datastores will be modelled as Storage objects with STI :type => ManageIQ::Providers::Ovirt::InfraManager::IsoDatastore
  • synchronize_advertised_images functionality is now in a refresh and the images will be persisted

Depends on:

TODO:

  • IsoDatastore references in UI
  • supports :iso_datastore feature
  • Test with manageiq-providers-red_hat_virtualization

Ref:

@miq-bot add_label enhancement
@miq-bot assign @agrare

@nasark
Copy link
Member Author

nasark commented Nov 28, 2022

Update: UI changes are complete

@nasark nasark force-pushed the move_iso_datastore branch 2 times, most recently from f62f423 to a76f371 Compare December 5, 2022 15:18
@nasark nasark force-pushed the move_iso_datastore branch 3 times, most recently from c137088 to 670c425 Compare December 6, 2022 15:11
@nasark nasark changed the title [WIP] Subclass IsoDatastore and transfer from core Subclass IsoDatastore and transfer from core Dec 6, 2022
@miq-bot miq-bot removed the wip label Dec 6, 2022
@nasark nasark force-pushed the move_iso_datastore branch from 670c425 to 0401dd8 Compare December 6, 2022 16:38
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Dec 7, 2022
@nasark nasark force-pushed the move_iso_datastore branch from 0401dd8 to 8fe7666 Compare December 12, 2022 20:46
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Dec 12, 2022
Comment on lines 105 to 114

def add_iso_images
add_collection(infra, :iso_images) do |builder|
builder.add_properties(
:parent_inventory_collections => %i(storages),
:manager_ref => %i[name],
:model_class => IsoImage
)
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks identical to https://github.com/ManageIQ/manageiq/pull/22239/files#diff-c07cbd5bcca8d8dfcae29bfd9c42c8933ea8f3f47844069b0e3f8d2374ed765dR299-R305 can we just add_collection(infra, :iso_images) above with the rest of the normal collection (lines 3:23) instead of overriding this?

@@ -0,0 +1,3 @@
FactoryBot.define do
factory :iso_datastore, :class => 'ManageIQ::Providers::Ovirt::InfraManager::IsoDatastore'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we should have , :parent => :storage_redhat

@@ -150,6 +150,10 @@ def templates
t
end

def advertised_images
[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we do handle targeted refresh of storage domains, but the manager.ovirt_services.advertised_images call only works for all storagedomains.

A good follow-up would be to extract the advertised_images method into the collector, then adding a targeted advertised_images that looks at references(:storagedomains)

@nasark nasark force-pushed the move_iso_datastore branch from 8fe7666 to fb76c53 Compare December 12, 2022 21:58
@miq-bot
Copy link
Member

miq-bot commented Dec 12, 2022

Some comments on commits nasark/manageiq-providers-ovirt@f2f2d7a~...fb76c53

spec/models/manageiq/providers/ovirt/infra_manager/iso_datastore_spec.rb

  • ⚠️ - 13 - Detected expect_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.

@miq-bot
Copy link
Member

miq-bot commented Dec 12, 2022

Checked commits nasark/manageiq-providers-ovirt@f2f2d7a~...fb76c53 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint
10 files checked, 3 offenses detected

app/models/manageiq/providers/ovirt/infra_manager/iso_datastore.rb

spec/models/manageiq/providers/ovirt/infra_manager/ovirt_services/v4_spec.rb

@nasark
Copy link
Member Author

nasark commented Dec 13, 2022

Cross-repo tests are green (manageiq-api failures are unrelated)

@agrare agrare closed this Dec 14, 2022
@agrare agrare reopened this Dec 14, 2022
@agrare agrare merged commit c6ac086 into ManageIQ:master Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants