Bug 998960

Summary: [origin_broker_86]Fail to add cartridge if cartridge-level variables already exist as user env variable
Product: OpenShift Online Reporter: zhaozhanqi <zzhao>
Component: MasterAssignee: Jhon Honce <jhonce>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: rpenta, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-20 19:19:56 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:

Description zhaozhanqi 2013-08-20 12:35:12 UTC
Description of problem:
add one env variable named cartridge-level variables like 'OPENSHIFT_POSTGRESQL_DB_PORT'. And then add postgresql cartridge, it will be failed and show 'Could not start Postgres'

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

How reproducible:
always

Steps to Reproduce:
1. create one app 
2. add one env variable named 'OPENSHIFT_POSTGRESQL_DB_PORT'
   curl -k -H 'Accept: application/xml' --user zzhao:redhat https://ec2-107-22-22-100.compute-1.amazonaws.com/broker/rest/applications/817232a8097a11e3b0fa22000ab30f72/environment-variables -X POST -d name=OPENSHIFT_POSTGRESQL_DB_PORT  -d value=333
3. add postgresql cartridge for this app
 rhc cartridge add -a app -c postgresql-8.4

Actual results:
step:3
rhc cartridge add -a zqphps -c postgresql-8.4
Adding postgresql-8.4 to application 'zqphps' ... Could not start Postgres


Expected results:
should be added successfully and OPENSHIFT_POSTGRESQL_DB_PORT will be covered with new value

Additional info:

Comment 1 Ravi Sankar 2013-08-20 18:41:34 UTC
Any env variables that will be written under .env dir during cartridge configure/post-configure/some other operation should delete those variables from .env/user_vars dir.

Comment 2 Jhon Honce 2013-08-20 19:19:56 UTC
Overriding this variables is a feature of user variables.  

Using correct values is up to the user.