Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-library/pull/66#discussion_r82875579
--- Diff:
software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/AbstractControllerImpl.java
---
@@ -317,6 +331,8 @@ protected void computePortsAndUrls() {
sensors().set(PROTOCOL, inferProtocol());
sensors().set(MAIN_URI, URI.create(inferUrl()));
+ sensors().set(MAIN_URI_MAPPED_SUBNET, URI.create("http://" +
sensors().get(SUBNET_ADDRESS) + ":" + sensors().get(PROXY_HTTP_PORT) + "/"));
+ sensors().set(MAIN_URI_MAPPED_PUBLIC,
URI.create(inferUrlPublic()));
--- End diff --
@neykov a very good point, but for `AbstractController` it is unfortunately
a special case. It wants to use the `domain` sensor for the hostname in the
URL, if set. This was added for `GeoscalingDnsService` (and is also useful for
things like AWS ELB).
We'd still like to advertise `MAIN_URI_MAPPED_PUBLIC`, but not with the
"normal" logic. The same goes I think for `MAIN_URI_MAPPED_SUBNET`: the
machine's subnet-address doesn't make sense if it's an AWS ELB that is being
used. We want `MAIN_URI_MAPPED_SUBNET` to always be populated, so that other
blueprints can use this without worrying about the type of load balancer.
This is probably worth further discussion. But in the mean time I suggest
we merge this PR, so we get it working (important for the tutorials/examples
that show a simple web-cluster being deployed to GCE and/or Azure).
I'll also look separately at improving `OnPublicNetworkEnricher` so that it
can read the public IP from a sensor (rather than only working if the public
mapping is registered in `PortForwardManager`, as is done for DNAT).
---
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.
---