Bug 1120413

Summary: Domain env variables not set when running cartridge install/setup scripts
Product: OpenShift Online Reporter: Ben Parees <bparees>
Component: PodAssignee: Derek Carr <decarr>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: ccoleman, decarr, jhou, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1120825 (view as bug list) Environment:
Last Closed: 2014-10-10 00:48:53 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: 1109058, 1118703, 1120825    

Description Ben Parees 2014-07-16 21:13:19 UTC
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

Comment 1 Derek Carr 2014-07-17 19:03:23 UTC
Fixed in PR:
https://github.com/openshift/origin-server/pull/5613

Comment 2 Jianwei Hou 2014-07-21 03:00:30 UTC
Verified on devenv_4988

1. Create one jenkins app and create one fuse app.
2. Create a second fuse app, and query the pending_op_groups from mongo shell, the domain env vars to add are listed in UpdateAppConfigOp:
{
          "_id": ObjectId("53ccb5ce5b41b4aad2000063"),
          "_type": "UpdateAppConfigOp",
          "add_env_vars": [
            {
              "component_id": ObjectId("53ccaf5e5b41b4aad2000032"),
              "key": "JENKINS_URL",
              "value": "https://jks-jhou.dev.rhcloud.com/"
            },
            {
              "component_id": ObjectId("53ccaf5e5b41b4aad2000032"),
              "key": "JENKINS_USERNAME",
              "value": "system_builder"
            },
            {
              "component_id": ObjectId("53ccaf5e5b41b4aad2000032"),
              "key": "JENKINS_PASSWORD",
              "value": "5Z1ascjBkPg2"
            },
            {
              "component_id": ObjectId("53ccb5815b41b4aad200003f"),
              "key": "OPENSHIFT_FUSE_DOMAIN_ZOOKEEPER_URL",
              "value": "fuse-jhou.dev.rhcloud.com:38037"
            },
            {
              "component_id": ObjectId("53ccb5815b41b4aad200003f"),
              "key": "OPENSHIFT_FUSE_DOMAIN_ZOOKEEPER_PASSWORD",
              "value": "nUfRnvnghPkN"
            }
          ],
          "add_keys_attrs": [ ],
          "config": {
            "auto_deploy": true,
            "deployment_branch": "master",
            "deployment_type": "git",
            "keep_deployments": 1
          },
          "created_at": ISODate("2014-07-21T06:40:14.715Z"),
          "gear_id": "53ccb5ce5b41b4aad200005b",
          "prereq": [
            "53ccb5ce5b41b4aad2000062"
          ],
          "recalculate_sshkeys": true,
          "remove_env_vars": [ ],
          "remove_keys_attrs": [ ],
          "retry_count": 0,
          "state": "init"
        },

The op id '53ccb5ce5b41b4aad2000063' is referenced in the AddCompOp
{
          "_id": ObjectId("53ccb5ce5b41b4aad2000064"),
          "_type": "AddCompOp",
          "comp_spec": {
            "cart": "fusesource-fuse-1.0.0",
            "cart_id": "53ccb5ce5b41b4aad200005a",
            "comp": "fusesource-fuse-1.0.0"
          },
          "created_at": ISODate("2014-07-21T06:40:14.716Z"),
          "gear_id": "53ccb5ce5b41b4aad200005b",
          "init_git_url": null,
          "prereq": [
            "53ccb5ce5b41b4aad2000063"
          ],
          "retry_count": 0,
          "skip_rollback": true,
          "state": "init"
        },