Bug 1121815

Summary: Do not delete domain env variables until no app references them.
Product: OpenShift Online Reporter: xjia <xjia>
Component: PodAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: bparees, decarr, jokerman, mmccomas, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-22 20:57:57 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:    
Bug Blocks: 1118703    

Description xjia 2014-07-22 01:19:22 UTC
Description of problem:
When the first app is created, domain env variables will be added in mongo. And the 2nd app will use these variables. But if delete the 2nd app, the domain env will be removed. 
This domain.env_vars might be recorded all the used app's component_id instead of only one component_id.

Version-Release number of selected component (if applicable):
devenv_4988
openshift-origin-cartridge-fuse-6.1.0.redhat.387-1.el6op.noarch.rpm

How reproducible:
always

Steps to Reproduce:
1. Create fuse app named fuse1, check domain.env_vars in mongo:
                {
                        "key" : "OPENSHIFT_FUSE_DOMAIN_ZOOKEEPER_URL",
                        "value" : "fuse1-jia.dev.rhcloud.com:38032",
                        "component_id" : ObjectId("53ccf97c6d011716f9000141")
                },
                {
                        "key" : "OPENSHIFT_FUSE_DOMAIN_ZOOKEEPER_PASSWORD",
                        "value" : "A7HGZegGHL3L",
                        "component_id" : ObjectId("53ccf97c6d011716f9000141")
                }

2. Create the 2nd fuse app named fuse2, check domain.env_vars in mongo(component_id is recovered!):
                {
                        "key" : "OPENSHIFT_FUSE_DOMAIN_ZOOKEEPER_URL",
                        "value" : "fuse1-jia.dev.rhcloud.com:38032",
                        "component_id" : ObjectId("53ccfbc76d011716f900015b")
                },
                {
                        "key" : "OPENSHIFT_FUSE_DOMAIN_ZOOKEEPER_PASSWORD",
                        "value" : "A7HGZegGHL3L",
                        "component_id" : ObjectId("53ccfbc76d011716f900015b")
                }
3.delete fuse2 app, these variables will be removed. 

Actual results:
Step3: None

Expected results:
Step3: Need still keep these variables

Comment 1 Derek Carr 2014-07-22 20:59:01 UTC
Domain environment variables are tied to a component in order to support cleanup when said component is removed.  They are intended to only be used to advertise among components across the domain (i.e Jenkins use case) and not be component indepedent at this time.