Bug 859565 - .dev.rhcloud.com matches
.dev.rhcloud.com matches
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
high Severity medium
: ---
: ---
Assigned To: Ram Ranganathan
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2012-09-21 18:08 EDT by Mike McGrath
Modified: 2015-05-14 18:59 EDT (History)
4 users (show)

See Also:
Fixed In Version: devenv_2550
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-11-06 13:48:54 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
ramr: needinfo+

Attachments (Terms of Use)

  None (edit)
Description Mike McGrath 2012-09-21 18:08:49 EDT
Some of our logic is using grep for .dev.rhcloud.com.  For example:

cartridges/diy-0.1.old/info/bin/build.sh:if `echo $OPENSHIFT_GEAR_DNS | grep -q .stg.rhcloud.com` || `echo $OPENSHIFT_GEAR_DNS | grep -q .dev.rhcloud.com`

grep .dev.rhcloud.com would also match blahdev.rhcloud.com even though the latter is prod and the former is dev.
Comment 1 Mike McGrath 2012-09-24 14:42:45 EDT
To further test this one, create an application with somethingdev as the domain (in prod).

See if application is available after update, we've had a few notes come in this week with that issue, they all were blah-somethingdev.rhcloud.com
Comment 2 Ram Ranganathan 2012-09-25 15:53:05 EDT
Yeah, looks like the jboss abstract + python + perl + diy all have it. 

Just changing those to [e]grep -q "\.dev\.rhcloud\.com" should fix it (similar treatment for stg). 

Will fix it along w/ another bug am working on.
Comment 3 Ram Ranganathan 2012-09-27 23:30:44 EDT
Fixed and wating on merge of pull request:
Comment 4 Xiaoli Tian 2012-09-28 04:09:03 EDT
Above code is merged in devenv_2550
Comment 7 Ram Ranganathan 2012-09-28 13:50:32 EDT
This works fine for me on devenv -- what's the errors/reason it failed QA?  Can you please add some more info/logs. 

Comment 8 Jianwei Hou 2012-09-28 22:50:45 EDT
(In reply to comment #7)
> This works fine for me on devenv -- what's the errors/reason it failed QA? 
> Can you please add some more info/logs. 
> Thanks.

Hi,Ram: in this script: https://github.com/ramr/crankcase/blob/56ac756dbfb6abaa8f5f8945baabb9fbd122b633/cartridges/python-2.6/info/bin/build.sh
there was a line(12): elif `echo $openshift_gear_dns | grep -qe "\.rhcloud\.com"`

I think $openshift_gear_dns should be upper case, like $OPENSHIFT_GEAR_DNS.
Otherwise, the regular expression won't be matched on prod
Comment 9 Ram Ranganathan 2012-09-30 02:53:12 EDT
@Hou, good catch -- you are right, that regexp won't match anything since the 
value would be "" and so  it won't match prod.  
Hmm, seems like that's a day 1 bug.
Comment 10 Ram Ranganathan 2012-10-01 14:46:17 EDT
Fixed with pull request: 

Waiting on merge.
Comment 11 Jianwei Hou 2012-10-07 22:20:54 EDT
Verified on devenv_2295

Tested for python app, regexp matches for both dev and prod

1. Create a python app
2. cd /var/lib/stickshift/$UUID/.env, modify OPENSHIFT_GEAR_DNS
for devenv: export OPENSHIFT_GEAR_DNS='py1-jhou.dev.rhcloud.com'
for prod: export OPENSHIFT_GEAR_DNS='py1-jhou.rhcloud.com'
3. Test regexp for both vars, test passed

So move this bug to verified.

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