Bug 1238305

Summary: [RFE] gear-placement plugin domain_id as input data
Product: OpenShift Container Platform Reporter: Ryan Howe <rhowe>
Component: RFEAssignee: Miciah Dashiel Butler Masters <mmasters>
Status: CLOSED ERRATA QA Contact: Johnny Liu <jialiu>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.2.0CC: adellape, anli, jokerman, kurktchiev, libra-bugs, libra-onpremise-devel, mmasters, mmccomas, rhowe, tiwillia
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-openshift-origin-controller-1.38.4.1-1.el6op Doc Type: Enhancement
Doc Text:
The author of a gear-placement plug-in may want to use the domain_id to determine where gears are placed. For example, applications in a particular domain may need to be isolated on a separate set of nodes in order to comply with requirements specified in external security policies. This enhancements expands the input parameters to gear-placement plug-ins to include the domain ID of the application, and as a result gear-placement plug-ins can now make placement decisions using applications' respective domain IDs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-17 17:10:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ryan Howe 2015-07-01 14:40:32 UTC
Looking to add domain_id as and input structure to determine where gears are placed using the gear-placement plugin.

Comment 3 Boris Kurktchiev 2015-07-10 19:12:30 UTC
The solution is pretty trivial. I am not exactly sure why the object gets stripped of the information before it gets passed on to other parts of the software but in order to get this info all that needs to occur is:
edit /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.35.1.3/app/plugin_models/application_properties.rb file and change the following lines:

1)  Add :namespace to:
attr_accessor :id, :name, :web_cartridge, :namespace

2) Add the following line to store namespace:

self.namespace = app.domain.namespace

This produces the following:
2015-06-30 16:35:15.559 [INFO ] app_props: #<ApplicationProperties:0x000000067b49f8
@id="5592fd7eb024e8c373000016",
@name="testphp3",
@namespace="middleware",
@web_cartridge="php-5.4"> (pid:1058)

-B

Comment 5 Miciah Dashiel Butler Masters 2015-09-25 22:51:01 UTC
Is the RFE only to pass the namespace to the plug-in as described in comment 3? From the initial description, I thought the RFE was to provide an example plug-in that scheduled based on the namespace, but just adding the namespace to app_props is much simpler.

Comment 6 Boris Kurktchiev 2015-10-02 14:34:21 UTC
My comment/ticket is what spawned the RFE, we need what I described in comment 3, to get the namspace to be passed in so it can be used in the scheduler plugin/custom plugins as needed. For whatever reason that information gets stripped before it gets to the gear_placement.rb

Comment 14 Anping Li 2015-11-26 04:58:04 UTC
Verified and pass. The namespace are passed to gear-placement plugin

2015-11-25 22:27:56.655 [INFO ] app_props: #<ApplicationProperties:0x000000079628a8
 @id="56567c3682611dbd88000001",
 @name="sphp",
 @namespace="anlidom",

Comment 16 errata-xmlrpc 2015-12-17 17:10:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2666.html