Description of problem: Using gear REST api , whatever the domain name is, it will add the event successfully. Version-Release number of selected component (if applicable): devenv_1997 How reproducible: always Steps to Reproduce: 1.create domain :wsundevman 2.create app:myapp1 3.Get gear usage using REST api with wrong domain curl -k -X GET -H "Accept: application/xml" --user wsun:redhat https://ec2-174-129-77-200.compute-1.amazonaws.com/broker/rest/domains/a/applications/myapp1/gears Actual results: [openshift@localhost wsun]$ curl -k -X GET -H "Accept: application/xml" --user wsun:redhat https://ec2-174-129-77-200.compute-1.amazonaws.com/broker/rest/domains/a/applications/myapp1/gears <?xml version="1.0" encoding="UTF-8"?> <response> <supported-api-versions> <supported-api-version>1.0</supported-api-version> <supported-api-version>1.1</supported-api-version> </supported-api-versions> <messages/> <version>1.1</version> <data> <gear> <uuid>14700405ed7e4598b94b2a0be5b73232</uuid> <components> <component> <internal-port nil="true"></internal-port> <name>php-5.3</name> <proxy-host nil="true"></proxy-host> <proxy-port nil="true"></proxy-port> </component> <component> <database-name>myapp1</database-name> <connection-url>mysql://127.0.250.129:3306/</connection-url> <password>7wy8YTMt3lmH</password> <username>admin</username> <internal-port nil="true"></internal-port> <name>mysql-5.1</name> <proxy-host nil="true"></proxy-host> <proxy-port nil="true"></proxy-port> </component> </components> </gear> </data> <type>gears</type> <status>ok</status> </response> Expected results: it should return error message like, "domain does not exist" Additional info: [openshift@localhost wsun]$ curl -k -X GET -H "Accept: application/xml" --user wsun:redhat https://ec2-174-129-77-200.compute-1.amazonaws.com/broker/rest/domains/a/applications/myapp1/ <?xml version="1.0" encoding="UTF-8"?> <response> <supported-api-versions> <supported-api-version>1.0</supported-api-version> <supported-api-version>1.1</supported-api-version> </supported-api-versions> <messages> <message> <exit-code>127</exit-code> <field nil="true"></field> <severity>error</severity> <text>Domain not found.</text> </message> </messages> <version>1.1</version> <data> <datum nil="true"></datum> </data> <type nil="true"></type> <status>not_found</status> </response>
We have this issue from day 1. This is not specific to gear REST api, any REST api may have this issue. Given valid 'user' and valid user 'application', we are able to retrieve app information and it doesn't care about the domain. This will be fixed by EOD along with duplicate code cleanup in REST api controllers.
https://github.com/openshift/li/pull/280
Fixed in git revision bb8b12198.
verified on devenv-stage_233 1.create a domain:wsundev823 2.2.create app:phptest 3.Get gear usage using REST api with wrong domain [sunwei@dhcp-8-229 dev]$ curl -k -X GET -H "Accept: application/xml" --user wsun:redhat https://ec2-23-22-239-11.compute-1.amazonaws.com/broker/rest/domains/a/applications/phptest/gears <?xml version="1.0" encoding="UTF-8"?> <response> <type nil="true"></type> <version>1.1</version> <supported-api-versions> <supported-api-version>1.0</supported-api-version> <supported-api-version>1.1</supported-api-version> </supported-api-versions> <data> <datum nil="true"></datum> </data> <status>not_found</status> <messages> <message> <field nil="true"></field> <exit-code>127</exit-code> <text>Domain a not found</text> <severity>error</severity> </message> </messages> </response>