Github user geomacy commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/746#discussion_r126373385
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
 ---
    @@ -449,21 +494,28 @@ public static VersionedName getVersionedName(Map<?,?> 
catalogMetadata, boolean r
             return new VersionedName(bundle, version);
         }
     
    -    private void collectCatalogItems(String yaml, 
List<CatalogItemDtoAbstract<?, ?>> result, Map<?, ?> parentMeta) {
    +    /** See comments on {@link 
#collectCatalogItemsFromItemMetadataBlock(String, ManagedBundle, Map, List, 
boolean, Map, int, boolean)};
    +     * this is a shell around that that parses the `brooklyn.catalog` 
header on the BOM YAML file */
    +    private void collectCatalogItemsFromCatalogBomRoot(String yaml, 
ManagedBundle containingBundle, List<CatalogItemDtoAbstract<?, ?>> result, 
boolean requireValidation, Map<?, ?> parentMeta, int depth, boolean force) {
             Map<?,?> itemDef = Yamls.getAs(Yamls.parseAll(yaml), Map.class);
             Map<?,?> catalogMetadata = getFirstAsMap(itemDef, 
"brooklyn.catalog").orNull();
             if (catalogMetadata==null)
                 log.warn("No `brooklyn.catalog` supplied in catalog request; 
using legacy mode for "+itemDef);
             catalogMetadata = MutableMap.copyOf(catalogMetadata);
     
    -        collectCatalogItems(Yamls.getTextOfYamlAtPath(yaml, 
"brooklyn.catalog").getMatchedYamlTextOrWarn(), 
    -            catalogMetadata, result, parentMeta);
    +        
collectCatalogItemsFromItemMetadataBlock(Yamls.getTextOfYamlAtPath(yaml, 
"brooklyn.catalog").getMatchedYamlTextOrWarn(), 
    +            containingBundle, catalogMetadata, result, requireValidation, 
parentMeta, 0, force);
             
             itemDef.remove("brooklyn.catalog");
             catalogMetadata.remove("item");
             catalogMetadata.remove("items");
             if (!itemDef.isEmpty()) {
    -            log.debug("Reading brooklyn.catalog peer keys as item 
('top-level syntax')");
    +            // AH - i forgot we even supported this. probably no point 
anymore,
    +            // now that catalog defs can reference an item yaml and things 
can be bundled together?
    +            log.warn("Reading catalog item from sibling keys of 
`brooklyn.catalog` section, "
    --- End diff --
    
    I vote we deprecate it!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to