Github user sjcorbett commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/156#discussion_r17300329
--- Diff:
usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
---
@@ -122,14 +123,13 @@ private ManagementContext
getBrooklynManagementContext(CampPlatform platform) {
app.child(childSpec);
}
- if (shouldUnwrap(template, app)) {
+ if (autoUnwrapIfPossible && shouldUnwrap(template, app)) {
EntitySpec<? extends Application> oldApp = app;
app = (EntitySpec<? extends Application>)
Iterables.getOnlyElement( app.getChildren() );
+
// if promoted, apply the transformations done to the app
- // (normally this will be done by the resolveSpec call above)
- if (app.getDisplayName()==null)
app.displayName(oldApp.getDisplayName());
- app.tags(oldApp.getTags());
- app.locations(oldApp.getLocations());
+ // (transformations will be done by the resolveSpec call
above, but we are collapsing oldApp so transfer to app=newApp)
+ AddChildrenEffector.collapseSpec(oldApp, app);
--- End diff --
Appreciate there is a 'where should this live long-term?' comment on
`collapseSpec`, but suggest resolving its location now - it's a bit surprising
to be referring to `AddChildrenEffector` from brooklyn-camp.
---
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.
---