Bug 1444484

Summary: Expose container projects and template parms in service model
Product: Red Hat CloudForms Management Engine Reporter: ncatling
Component: AutomateAssignee: Greg McCullough <gmccullo>
Status: CLOSED CURRENTRELEASE QA Contact: Dmitry Misharov <dmisharo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: akarol, azellner, cpelland, fsimonce, gmccullo, jhardy, mkanoor, mtayer, ncatling, obarenbo, tfitzger
Target Milestone: GAKeywords: Regression, TestOnly, ZStream
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: automate:container
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1444494 1460027 (view as bug list) Environment:
Last Closed: 2018-03-06 14:46:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1444494, 1460027    

Description ncatling 2017-04-21 12:28:50 UTC
Description of problem:
Container projects and template parameters not available associations in Automate.

Functionality contained within this PR, which would need to be backported to 5.7.
https://github.com/ManageIQ/manageiq/pull/14233

Version-Release number of selected component (if applicable):
5.7

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Milan Falešník 2017-05-02 11:45:33 UTC
I verified this bug on 5.8.0.12.

Though there is an issue, unrelated to this PR - It seems that via $evm.vmdb(:ExtManagementSystems).find_by_name(...) I can only get instances of MiqAeServiceManageIQ_Providers_ContainerManager and not MiqAeServiceManageIQ_Providers_OpenshiftEnterprise_ContainerManager, therefore I could not verify the link "expose :container_projects" on the provider. Due to underscores I cannot refer to the class directly from $evm.vmdb.

Is that a bug to be filed?

Comment 4 Greg McCullough 2017-05-02 13:44:48 UTC
Looks like you should be using ManageIQ::Providers::Openshift::ContainerManager now.  See https://github.com/ManageIQ/manageiq/pull/13908

Comment 5 Milan Falešník 2017-05-02 13:48:27 UTC
By looking at this:
https://github.com/ManageIQ/manageiq/pull/13908/files#diff-d836ac4b1b3b9c255283fe7142975b67

It seems like we lost the exposed items then, as these are deleted and there is no replacement, which would explain why I could not access it. This then seems like a FailedQA.

Comment 6 Greg McCullough 2017-05-02 14:01:12 UTC
Milan - I agree.  The removal of miq_ae_service_manageiq-providers-openshift_enterprise-container_manager.rb should have also moved the two `expose` lines to the new model.  This is a regression for the containers team.

Comment 7 Milan Falešník 2017-05-02 15:38:48 UTC
Bringing attention to the containers team, @azellner, could you take a look at  the link in comment 5 and what Greg said in comment 6? This needs fixing in order to pass this as verified, originally I thought there was a different way to get the right class, but moving back to assigned.

Comment 8 Ari Zellner 2017-05-07 10:56:53 UTC
I think https://github.com/ManageIQ/manageiq-automation_engine/pull/17 might fix this. nick, how do i test this out?

Comment 9 Milan Falešník 2017-05-09 08:21:24 UTC
Hey Ari,

1) Set up a provider in your CFME
2) open rails console
3)
$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
provider = $evm.vmdb(:ExtManagementSystem).find_by_name(<provider_name>)

Then you can try out the two relationships via automate engine:
provider.container_image_registries
provider.container_projects

They should not raise an error.

Comment 11 Ari Zellner 2017-05-11 10:59:52 UTC
tesing https://github.com/ManageIQ/manageiq-automation_engine/pull/17,
I used both:
$evm.vmdb(:ExtManagementSystem).all.first.container_projects
$evm.vmdb(:ExtManagementSystem).all.first.container_image_registries

and both returned correct results.
The provider type is now 'MiqAeServiceManageIQ_Providers_Openshift_ContainerManager' instead of the removed openshift enterprise provider.
should there be some sort of migration for this?

Comment 12 Milan Falešník 2017-05-12 16:28:03 UTC
I think there are no migrations in here as these service models just wrap the existing AR models in rails.

Comment 14 Milan Falešník 2017-10-12 11:36:03 UTC
Verified in 5.9.0.1.

Clearing the needinfo on Nick as well.