Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/149#discussion_r17198563
--- Diff:
software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNodeImpl.java
---
@@ -84,9 +84,9 @@ public void init() {
@Override
public void onEvent(SensorEvent<Boolean> booleanSensorEvent) {
if (Boolean.TRUE.equals(booleanSensorEvent.getValue())) {
- String hostname = getAttribute(HOSTNAME);
- String webPort =
getConfig(CouchbaseNode.COUCHBASE_WEB_ADMIN_PORT).iterator().next().toString();
- setAttribute(CouchbaseNode.COUCHBASE_WEB_ADMIN_URL,
format("http://%s:%s", hostname, webPort));
+ Integer webPort =
getAttribute(CouchbaseNode.COUCHBASE_WEB_ADMIN_PORT);
+ String hostAndPort =
BrooklynAccessUtils.getBrooklynAccessibleAddress(CouchbaseNodeImpl.this,
webPort).toString();
+ setAttribute(CouchbaseNode.COUCHBASE_WEB_ADMIN_URL,
format("http://%s", hostAndPort));
--- End diff --
I have slight hesitation about us advertising as the url the value needed
for accessing it from management node. If it is used outside of that particular
context, then it will fail. However, your change makes as much sense as the
previous code, and works in the docker use-case!
---
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.
---