Bug 1123944 - oo-app-info does not find gears / users based on app fqdn
Summary: oo-app-info does not find gears / users based on app fqdn
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-28 17:20 UTC by Eric Rich
Modified: 2014-08-26 13:53 UTC (History)
6 users (show)

Fixed In Version: openshift-origin-broker-util-
Doc Type: Bug Fix
Doc Text:
When the oo-app-info command was used to search for an application by its fully-qualified domain name (FQDN), the domain for the FQDN was assumed to be "rhcloud.com". As a result, the search did not work outside of the OpenShift Online environment. This bug fix updates the search to be generalized for any cloud domain, and searching for an application by its FQDN now works as expected.
Clone Of:
Last Closed: 2014-08-26 13:53:06 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1095 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.1.5 bug fix and enhancement update 2014-08-26 17:51:34 UTC
Red Hat Knowledge Base (Solution) 1145123 None None None Never

Description Eric Rich 2014-07-28 17:20:12 UTC
Description of problem:

oo-app-info never seems to do a search / return any results when searching for an fqdn. 

Version-Release number of selected component (if applicable): 
OpenShift Enterprise 2.1.3

How reproducible: Very

Steps to Reproduce:
1. # oo-app-info -f app-namespace.domain.com

Actual results:

Loading broker environment... 

Error: No apps found for fqdn: 'app-namespace.domain.com'

Expected results:

Loading broker environment... Done.                                                                                                                                                                        

      Login:         demo
      Plan:           ()

      App Name:      app
      App UUID:      53d674a6e3c9c3e8a2000005
      Creation Time: 2014-07-28 04:04:54 PM
      URL:           http://app-namespace.domain.com
      Group Instance[0]:
              Cartridge Name: php-5.4
              Component Name: php-5.4 
              Cartridge Name: acme-mock-plugin-0.2
              Component Name: acme-mock-plugin-0.2 
              Server Identity: node.domain.com
              Gear UUID:       53d674a6e3c9c3e8a2000005
              Gear UID:        5568
      Current DNS
     app-namespace.domain.com is an alias for app.domain.com.
     app.domain.com has address    

Comment 2 Brenton Leanhardt 2014-07-29 14:44:28 UTC
This patch should do it:

diff --git a/broker-util/lib/app_info.rb b/broker-util/lib/app_info.rb
index 4b20d7f..6ab4830 100755
--- a/broker-util/lib/app_info.rb
+++ b/broker-util/lib/app_info.rb
@@ -87,7 +87,7 @@ class AppInfo

 class AppQuery
-  FQDN_REGEX = /(http:\/\/)?(\w+)-(\w+)(\.\w+)?\.rhcloud.com\Z/
+  FQDN_REGEX = /(http:\/\/)?(\w+)-(\w+)(\.\w+)?\.#{Regexp.escape(Rails.application.config.openshift[:domain_suffix])}\Z/

   # Entrypoint for openshift application query methods

Comment 3 Luke Meyer 2014-08-04 17:56:07 UTC
This sort of thing drives me bonkers.

Comment 5 openshift-github-bot 2014-08-05 19:13:39 UTC
Commit pushed to master at https://github.com/openshift/origin-server

oo-app-info: don't assume rhcloud.com app domain

Bug 1123944 - oo-app-info does not find gears / users based on app fqdn

The search for an app fqdn was poorly implemented, as it assumed the
domain on the fqdn is rhcloud.com. This change generalizes the search to
use the configured cloud domain in the fqdn.

Comment 6 Luke Meyer 2014-08-05 19:26:17 UTC
Can't exactly test this upstream, due to bug 1126888 - but it works under OSE.

Comment 10 errata-xmlrpc 2014-08-26 13:53:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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