[jbosstools-issues] [JBoss JIRA] (JBIDE-15429) openshift-java-client: add support for downloadable cartridges
Andre Dietisheim (JIRA)
jira-events at lists.jboss.org
Mon Sep 23 11:10:45 EDT 2013
[ https://issues.jboss.org/browse/JBIDE-15429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806621#comment-12806621 ]
Andre Dietisheim commented on JBIDE-15429:
------------------------------------------
The first problem that arose is that OpenShift apparently wont handle parameter arrays and maps correctly:
If I try to create a web-cartridge jbossas-7 with a downloadable cartridge foreman the app is created but the embedded foreman cartridge is ignored:
{code}
curl -H "Accept: application/json; version=1.2" --user USER:PASSWORD https://openshift.redhat.com/broker/rest/domains/foogoo/applications -X POST -d name=scalable2 -dcartridges[][name]=jbossas-7 -dcartridges[][name]="http://cartreflect-claytondev.rhcloud.com/reflect?github=ncdc/openshift-foreman-cartridge
{code}
The resulting app has no foreman cartridge embedded (empty "embedded"):
{code}
{
"api_version":1.2,
"data":{
"aliases":[
],
"app_url":"http://scalable2-foogoo.rhcloud.com/",
"build_job_url":null,
"building_app":null,
"building_with":null,
"creation_time":"2013-09-23T14:47:53Z",
"domain_id":"foogoo",
"embedded":{
},
"framework":"jbossas-7",
{code}
If on the other hand, I try to create an app with a downloadable web-cartridge and a normal add-on cartridge, the request errors and complains that there is no web-cartridge being supplied:
{code}
curl -H "Accept: application/json; version=1.2" --user USER:PASSWORD https://openshift.redhat.com/broker/rest/domains/foogoo/applications -X POST -d name=scalable3 -dcartridges[][url]=claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-go-cart -dcartridges[][name]=mysql
{code}
The error that is reported by the REST service:
{code}
{
"api_version":1.2,
"data":null,
"messages":[
{
"exit_code":109,
"field":"cartridge",
"severity":"error",
"text":"Each application must contain one web cartridge. None of the specified cartridges mysql is a web cartridge. Please include one of the following cartridges: nodejs-0.6, nodejs-0.10, python-3.3, python-2.7, python-2.6, zend-5.6, ruby-1.9, ruby-1.8, jenkins-1, jbossews-2.0, jbossews-1.0, perl-5.10, php-5.3, jbosseap-6, diy-0.1, and jbossas-7 or supply a valid url to a custom web_framework cartridge."
}
],
"status":"unprocessable_entity",
"supported_api_versions":[
1.0,
1.1,
1.2,
1.3,
1.4,
1.5,
1.6
],
"type":null,
"version":"1.2"
}
{code}
I did some googling and found some references that show that older Rails version were supporting these parameter arrays and maps:
https://github.com/RestKit/RestKit/pull/697
But for some unknown reason this support is not present any more as the above request show.
In result I had to switch to json encoded parameters which works flawlessly.
Requesting the above in json looks as follows:
{code}
curl -H "Content-Type: application/json" -H "Accept: application/json; version=1.2" --user USER:PASSWORD https://openshift.redhat.com/broker/rest/domains/foobarz/applications -X POST -d '{ "name":"as71", "cartridges":[ { "name":"jbossas-7" }, { "url":"http://cartreflect-claytondev.rhcloud.com/reflect?github=ncdc/openshift-foreman-cartridge" } ] }'
{code}
> openshift-java-client: add support for downloadable cartridges
> --------------------------------------------------------------
>
> Key: JBIDE-15429
> URL: https://issues.jboss.org/browse/JBIDE-15429
> Project: Tools (JBoss Tools)
> Issue Type: Feature Request
> Components: openshift
> Affects Versions: 4.1.0.Final
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Labels: openshift-java-client
> Fix For: 4.2.0.Alpha1
>
>
> OpenShift added support for downloadable cartridges lately. This allows you to provide your very own cartridge by providing a git-url where it may be checked out.
> Fusesource provided a PR on github that we should merge in: https://github.com/openshift/openshift-java-client/pull/68
> The PR seems perfectly functional but it has a few shortcomings though that we have to fix though (see comments in the PR)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list