GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/128

    jclouds.ImageChooser configurable

    This makes a custom-supplied `JcloudsLocationConfig.IMAGE_CHOOSER` 
customizable: if it implements `ConfigAwareChooser` then `cloneFor(ConfigBag)` 
will be called. This follows the same pattern as `ComputeServiceAwareChooser` 
(both inside `BrooklynImageChooser`).
    
    This also adds `BrooklynImageChooser.imageChooserFromOrderings(Iterable<? 
extends Ordering<? super Image>>)`, so that a downstream image chooser can 
supply multiple orderings (the first taking priority, and subsequent ones to 
break any ties).
    
    Strictly speaking, this is a break to semantic versioning to put this in 
the 0.9.x branch. However, the ImageChooser is quite niche. (Frankly, we should 
have marked `BrooklynImageChooser` as `@Beta` until it had been used in anger 
in more places.) The change is backwards compatible. It's just that if someone 
used this in a 0.9.1 and then switched back to 0.9.0 then they 
`ConfigAwareChooser` wouldn't be there so it wouldn't compile. On balance, I'm 
fine with us making that sacrifice.
    
    The use case is...
    
    On VMware vCloudDirector there is a customer preference for VM images that 
are local to the vDC (virtual datacenter) over those in other vDCs and public 
images. They are using imageNameRegex so jclouds can return us the 
corresponding image in multiple vDCs and in the public catalog. To choose the 
local image in a Brooklyn image chooser, we need to know where the VM is going 
to be provisioned. We therefore need to know the config being supplied to the 
`jcloudsLocation.obtain()` method *inside* an image chooser.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server 
fix/ImageChooser-configurable-0.9.x

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/128.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #128
    
----
commit 0d90f5a1f53416be0059429bf673c01756d80b83
Author: Aled Sage <[email protected]>
Date:   2016-04-27T22:38:48Z

    Add AbstractJcloudsStubbedLiveTest.getLocationSpec

commit d8d00d88077be5e784a5f2f0f6368d0cc7e4b8ab
Author: Aled Sage <[email protected]>
Date:   2016-04-28T06:41:27Z

    jclouds.imageChooser customisable with provisioning config

----


---
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