Bug 963080 - [Card#554] The url of the cartridge can not be returned when retrieved via /application/<app>/cartridges
[Card#554] The url of the cartridge can not be returned when retrieved via /a...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Kubernetes (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rajat Chopra
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-15 02:19 EDT by Jianwei Hou
Modified: 2015-05-14 20:16 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-11 00:03:42 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)
Returned content in step 2 (8.87 KB, application/octet-stream)
2013-05-15 02:19 EDT, Jianwei Hou
no flags Details
Returned content in step 3 (8.04 KB, application/octet-stream)
2013-05-15 02:21 EDT, Jianwei Hou
no flags Details

  None (edit)
Description Jianwei Hou 2013-05-15 02:19:27 EDT
Created attachment 748072 [details]
Returned content in step 2

Description of problem:
After an application is created with a cartridge url, when it's being retrieved via /application/<app>/cartridges, the url of the cartridge is NOT displayed.

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

How reproducible:
Always

Steps to Reproduce:
1. Create an application with a manifest from an url:
curl -s -k -H 'Content-Type: Application/json' --user jhou@redhat.com:x https://ec2-50-17-3-43.compute-1.amazonaws.com/broker/rest/domains/jhou/applications/ -X POST -d '{"name":"app1", "cartridge":{"url":"https://raw.github.com/jhou1/v2php/master/metadata/manifest.yml"}} | json_reformat

2. After the app is created, retrieve the cartridge info via /application/app1/cartridges
curl -s -k -H 'Content-Type: Application/json' --user jhou@redhat.com:x https://ec2-50-17-3-43.compute-1.amazonaws.com/broker/rest/domains/jhou/applications/app1/cartridges/ -X GET|json_reformat

3. Retrieve its info via cartridge name - /application/app1/cartridges/jhouphp-5.3
curl -s -k -H 'Content-Type: Application/json' --user jhou@redhat.com:x https://ec2-50-17-3-43.compute-1.amazonaws.com/broker/rest/domains/jhou/applications/app1/cartridges/jhouphp-5.3 -X GET|json_reformat
  
Actual results:
In step 2 and 3, none of them displayed the url of the provided manifest.yml of the cartridge.

Expected results:
The url of the provided manifest should be displayed when retrieved via REST API, eg: "url": "https: //raw.github.com/jhou1/v2php/master/metadata/manifest.yml" 


Additional info:
Added attachment of the returned content by REST API
Comment 1 Jianwei Hou 2013-05-15 02:21:38 EDT
Created attachment 748073 [details]
Returned content in step 3
Comment 2 Rajat Chopra 2013-05-16 13:27:03 EDT
Fixed with rev#6964cf019bf6316b53f6fe5dc1f33350c8db48cc
Comment 3 Xiaoli Tian 2013-05-17 05:39:05 EDT
Tested it on devenv_3238, created an app with  https://raw.github.com/openshift/downloadable-mock/master/metadata/manifest.yml, but the url is null:

#curl -s -k -H 'Content-Type: Application/json' --user xtian+t1@redhat.com:12 https://localhost/broker/rest/domains/domx1/applications/mockapp/cartridges/downloadable-mock-0.1 -X GET|python -m json.tool|grep url
        "license_url": "", 
        "url": null, 
# curl -s -k -H 'Content-Type: Application/json' --user xtian+t1@redhat.com:12 https://localhost/broker/rest/domains/domx1/applications/mockapp/cartridges -X GET|python -m json.tool |grep url
            "license_url": "", 
            "url": null, 



# curl -s -k -H 'Content-Type: Application/json' --user xtian+t1@redhat.com:12 https://localhost/broker/rest/domains/domx1/applications/mockapp/cartridges -X GET|python -m json.tool
{
    "data": [
        {
            "additional_gear_storage": 0, 
            "base_gear_storage": 1, 
            "collocated_with": [], 
            "current_scale": 1, 
            "description": "A downloadable mock cartridge for development use only.", 
            "display_name": "Downloadable Mock Cartridge 0.1", 
            "gear_profile": "small", 
            "help_topics": {}, 
            "license": "ASL 2.0", 
            "license_url": "", 
            "links": {
                "DELETE": {
              ''''''''
             "tags": [
              "service", 
              "web_framework"
            ], 
            "type": "standalone", 
            "url": null, 
            "usage_rates": [], 
            "version": "0.1", 
            "website": 


# curl -s -k -H 'Content-Type: Application/json' --user xtian+t1@redhat.com:12 https://localhost/broker/rest/domains/domx1/applications/mockapp/cartridges/downloadable-mock-0.1 -X GET|python -m json.tool
{
    "data": {
        "additional_gear_storage": 0, 
        "base_gear_storage": 1, 
        "collocated_with": [], 
        "current_scale": 1, 
        "description": "A downloadable mock cartridge for development use only.", 
        "display_name": "Downloadable Mock Cartridge 0.1", 
        "gear_profile": "small", 
        "help_topics": {}, 
        "license": "ASL 2.0", 
        "license_url": "", 
        "links": {
            "DELETE": {
                "href": "https://localhost/broker/rest/domains/domx1/applications/mockapp/cartridges/downloadable-mock-0.1", 
                "method": "DELETE", 

 '''''''''
  "scales_from": 1, 
        "scales_to": 1, 
        "scales_with": null, 
        "status_messages": null, 
        "supported_scales_from": 1, 
        "supported_scales_to": 1, 
        "tags": [
            "service", 
            "web_framework"
        ], 
        "type": "standalone", 
        "url": null, 
        "usage_rates": [], 
        "version": "0.1", 
        "website": ""
Comment 4 Rajat Chopra 2013-05-17 11:07:45 EDT
refixed in pull request#2531
Comment 5 Jianwei Hou 2013-05-20 02:29:56 EDT
Verified on devenv_3247

steps:
1. Create an app with a cartridge url
curl -s -k -H 'Content-Type: Application/json' --user jhou@redhat.com:redhat https://ec2-107-22-114-11.compute-1.amazonaws.com/broker/rest/domains/jhou/applications/ -X POST -d '{"name":"app1", "cartridge":{"url":"https://raw.github.com/xltian/perltestonly/master/metadata/manifest.yml"}}'
2. After app is created, retrieve it's info with REST API
curl -s -k -H 'Content-Type: Application/json' --user jhou@redhat.com:x https://ec2-107-22-114-11.compute-1.amazonaws.com/broker/rest/domains/jhou/applications/app1/cartridges -X GET |json_reformat
<------------------------------>
 "type": "standalone",
            "url": "https://raw.github.com/xltian/perltestonly/master/metadata/manifest.yml",
            "usage_rates": [
.....
<------------------------------>
3. Repeat step 2 with "/cartridges/perlv2-5.10"
curl -s -k -H 'Content-Type: Application/json' --user jhou@redhat.com:x https://ec2-107-22-114-11.compute-1.amazonaws.com/broker/rest/domains/jhou/applications/app1/cartridges/perlv2-5.10 -X GET |json_reformat
<------------------------------>
 "type": "standalone",
            "url": "https://raw.github.com/xltian/perltestonly/master/metadata/manifest.yml",
            "usage_rates": [
.....
<------------------------------>

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