[ 
https://issues.apache.org/jira/browse/BROOKLYN-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15010748#comment-15010748
 ] 

Svetoslav Neykov commented on BROOKLYN-195:
-------------------------------------------

The current implementation allows anything in the catalog item when marked as 
*itemType: template*. This is to handle items which contain placeholders to be 
replaced by the user - literally a template.
The user interface on the other hand uses *template* as a marker to show items 
in the app wizard, but uses them as regular items, doesn't populate the yaml 
editor with the contents of the catalog item.
Clearly the above two conflict. Catalog items as literal templates shouldn't be 
needed so frequently now that we have parameters. Perhaps we should just leave 
it as a marker for the app wizard, renaming it to *application* type. Any 
thoughts [~alex.heneveld]?

> Invalid catalog item can be posted to catalog
> ---------------------------------------------
>
>                 Key: BROOKLYN-195
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-195
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Martin Harris
>            Priority: Minor
>
> The following YAML can be posted to the catalog
> {noformat}
> brooklyn.catalog:
>   id: invalid-catalog-item
>   version: 1.0
>   displayName: Invalid Catalog Item
>   itemType: template
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
> - type: org.apache.brooklyn.entity.stock.BasicApplication
> {noformat}
> E.g. by using the following curl command 
> curl http://localhost:8081/v1/catalog --data-binary @`pwd`/services.yaml
> This will return a 201 and the catalog item will be created. However, when 
> trying to deploy the catalog item, the following error is returned:
> {noformat}
> Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this 
> plan: Transformer for catalog gave an error creating this plan: Transformer 
> for Brooklyn OASIS CAMP interpreter gave an error creating this plan: 
> java.lang.UnsupportedOperationException: Single service expected, but got 
> [EntitySpec{type=interface 
> org.apache.brooklyn.entity.stock.BasicApplication}, EntitySpec{type=interface 
> org.apache.brooklyn.entity.stock.BasicApplication}]
> {noformat}
> As the use of multiple services is not supported, Brooklyn should not allow 
> the catalog item to be created
> Marked as low priority as the workaround is fairly simple (i.e. use the 
> following YAML):
> {noformat}
> brooklyn.catalog:
>   id: invalid-catalog-item
>   version: 1.0
>   displayName: Invalid Catalog Item
>   itemType: template
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
>   brooklyn.children:
>   - type: org.apache.brooklyn.entity.stock.BasicApplication
>   - type: org.apache.brooklyn.entity.stock.BasicApplication
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to