Bug 1120825

Summary: Domain env variables not set when running cartridge install/setup scripts
Product: OpenShift Container Platform Reporter: Brenton Leanhardt <bleanhar>
Component: NodeAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 2.1.0CC: adellape, bparees, ccoleman, decarr, jokerman, libra-bugs, libra-onpremise-devel, mmccomas, xjia
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-openshift-origin-controller-1.23.10.8-1.el6op Doc Type: Bug Fix
Doc Text:
Previously, domain environment variables were not set when running cartridge install and setup scripts. This was due to a bug in the broker's Application model object. This bug fix updates the Application model, and environment variables are now correctly set before running the install and setup scripts.
Story Points: ---
Clone Of: 1120413 Environment:
Last Closed: 2014-08-26 13:52:49 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:
Bug Depends On: 1120413    
Bug Blocks: 1109058    

Description Brenton Leanhardt 2014-07-17 19:27:02 UTC
+++ This bug was initially created as a clone of Bug #1120413 +++

Description of problem:
Domain environment variables are not available to cartridge install/setup scripts.

The UpdateAppConfigOp (which sets domain env vars) is running after the AddCompOp (which runs the install/setup scripts).

The issue appears to be that UpdateAppConfigOp should be in the gear_id_preqreqs op list, and it is not.


Actual results:
domain env vars are not set when the install script is running


Expected results:
domain env vars should be set when the install script is running

--- Additional comment from Derek Carr on 2014-07-17 15:03:23 EDT ---

Fixed in PR:
https://github.com/openshift/origin-server/pull/5613

Comment 2 Brenton Leanhardt 2014-08-01 13:11:16 UTC
Upstream commit:

commit 91160713f81417f710025eb6888a6c97e5704b05
Author: derekwaynecarr <decarr>
Date:   Thu Jul 17 14:59:06 2014 -0400

    Ensure domain environment variables are passed to cartridge install scripts

Comment 3 Ben Parees 2014-08-01 19:11:20 UTC
Brenton, this has become urgent for the QE team, can we get it into a puddle soon?

Thanks.

Comment 4 Brenton Leanhardt 2014-08-01 19:18:49 UTC
I'm testing a puddle right now.  Should be read today.

Comment 7 xjia 2014-08-04 06:17:27 UTC
Version:
2.1.z/2014-08-01.1/
rubygem-openshift-origin-controller-1.23.10.8-1.el6op.noarch

Verify:
1. Create a fuse app named fuse01
2. Create a second app named fuse02, at the mean time monitor application collection in mongodb 
> db.applications.findOne({"canonical_name" : "fuse02"})
{
	"_id" : ObjectId("53df246e41312e8571000065"),
	"pending_op_groups" : [
		{
			"pending_ops" : [
				{
					"_id" : ObjectId("53df246e41312e857100006d"),
					"state" : "init",
					"retry_count" : 0,
					"_type" : "UpdateAppConfigOp",
					"add_keys_attrs" : [ ],
					"remove_keys_attrs" : [ ],
					"add_env_vars" : [
						{
							"key" : "OPENSHIFT_FUSE_DOMAIN_ZOOKEEPER_URL",
							"value" : "fuse01-xuan.fuse.com:44937",
							"component_id" : ObjectId("53df223741312e857100002c")
						},
						{
							"key" : "OPENSHIFT_FUSE_DOMAIN_ZOOKEEPER_PASSWORD",
							"value" : "M4ngAIqPjhma",
							"component_id" : ObjectId("53df223741312e857100002c")
						}
					],
					"remove_env_vars" : [ ],
					"config" : {
						"auto_deploy" : true,
						"deployment_branch" : "master",
						"keep_deployments" : 1,
						"deployment_type" : "git"
					},
					"gear_id" : "53df246e41312e8571000065",
					"prereq" : [
						"53df246e41312e857100006c"
					],
					"recalculate_sshkeys" : true,
					"created_at" : ISODate("2014-08-04T06:13:02.961Z")
				},

Comment 9 errata-xmlrpc 2014-08-26 13:52:49 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.

http://rhn.redhat.com/errata/RHBA-2014-1095.html