Bug 988794 - [origin_runtime_160]Can not get published env vars
[origin_runtime_160]Can not get published env vars
Status: CLOSED NOTABUG
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Dan McPherson
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-26 07:41 EDT by Wei Sun
Modified: 2015-05-14 19:24 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-29 21:55:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wei Sun 2013-07-26 07:41:28 EDT
Description of problem:
Create a mock-0.1 app with mock-plugin-0.1,and log in app,check all mock-plugin-0.1 published env vars ,but can not get mock-plugin-0.1 published env vars. 

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

How reproducible:
Always

Steps to Reproduce:
1.Create a mock-0.1 app with mock-plugin-0.1 
2.Log in instance,check /var/lib/openshift/.cartridge_repository/redhat-mock/0.0.1/metadata/manifest.yml
3.Log in instance,check /var/lib/openshift/.cartridge_repository/redhat-mock-plugin/0.0.1/hooks/publish-db-connection-info
4.Log in instance,check /var/lib/openshift/.cartridge_repository/redhat-mock-plugin/0.0.1/metadata/manifest.yml
5.Log in app,check all mock-plugin-0.1 published env vars

Actual results:
2.There is a filed:
Subscribes:
  set-env:
    Type: "ENV:*"
    Required: false

3.There are some env vars
echo "OPENSHIFT_MOCK_PLUGIN_DB_USERNAME=UT_username"
echo "OPENSHIFT_MOCK_PLUGIN_DB_PASSWORD=UT_password"
echo "OPENSHIFT_MOCK_PLUGIN_GEAR_UUID=$OPENSHIFT_GEAR_UUID"
echo "OPENSHIFT_MOCK_PLUGIN_DB_HOST=$OPENSHIFT_MOCK_PLUGIN_EXAMPLE_IP1"
echo "OPENSHIFT_MOCK_PLUGIN_DB_PORT=$OPENSHIFT_MOCK_PLUGIN_EXAMPLE_PORT1"
echo "OPENSHIFT_MOCK_PLUGIN_DB_URL=mock://${OPENSHIFT_MOCK_PLUGIN_EXAMPLE_IP1}:${OPENSHIFT_MOCK_PLUGIN_EXAMPLE_PORT1}/unit_test"

4.There is a filed:
Publishes:
  publish-db-connection-info:
    Type: "ENV:NET_TCP:db:connection-info"

5.Can not get mock-plugin-0.1 published env vars
[mock-wsunfull3564.dev.rhcloud.com 51f2584fae641a08ea00004f]\> env|grep OPENSHIFT_MOCK_PLUGIN_DB_USERNAME
[mock-wsunfull3564.dev.rhcloud.com 51f2584fae641a08ea00004f]\> env|grep OPENSHIFT_MOCK_PLUGIN_DB_PASSWORD
[mock-wsunfull3564.dev.rhcloud.com 51f2584fae641a08ea00004f]\> env|grep OPENSHIFT_MOCK_PLUGIN_GEAR_UUID
[mock-wsunfull3564.dev.rhcloud.com 51f2584fae641a08ea00004f]\> env|grep OPENSHIFT_MOCK_PLUGIN_DB_HOST
[mock-wsunfull3564.dev.rhcloud.com 51f2584fae641a08ea00004f]\> env|grep OPENSHIFT_MOCK_PLUGIN_DB_POR


Expected results:
Should have mock-plugin-0.1 published env vars.

Additional info:
Comment 1 Dan McPherson 2013-07-29 18:29:19 EDT
Was this a scaled mock app?  This the connection hooks currently only apply to scaled apps:

When I tried I got:

[root@ip-10-164-8-176 openshift]# ls mock2-danmcp1/.env/mock-plugin/
OPENSHIFT_MOCK_PLUGIN_DB_HOST      OPENSHIFT_MOCK_PLUGIN_DB_PORT  OPENSHIFT_MOCK_PLUGIN_DB_USERNAME
OPENSHIFT_MOCK_PLUGIN_DB_PASSWORD  OPENSHIFT_MOCK_PLUGIN_DB_URL   OPENSHIFT_MOCK_PLUGIN_GEAR_UUID


On my gear with mock (mock-plugin was installed on another gear)
Comment 2 Wei Sun 2013-07-29 21:55:14 EDT
Check on devenv_3580,create a scaling app with mock-plugin,and could get all mock-plugin-0.1 published env vars.Thanks.

Result:
[mocks-wsundev3580.dev.rhcloud.com 51f71bddc918930a91000001]\> env|grep -i mock_plugin
OPENSHIFT_MOCK_PLUGIN_DB_USERNAME=UT_username
OPENSHIFT_MOCK_PLUGIN_DB_HOST=127.0.250.129
OPENSHIFT_MOCK_PLUGIN_DB_PORT=8080
OPENSHIFT_MOCK_PLUGIN_DB_PASSWORD=UT_password
OPENSHIFT_MOCK_PLUGIN_DB_URL=mock://127.0.250.129:8080/unit_test
OPENSHIFT_MOCK_PLUGIN_GEAR_UUID=51f71bddc918930a91000002

Note You need to log in before you can comment on or make changes to this bug.