Relation addresses

William Reade william.reade at canonical.com
Tue Jun 17 07:42:57 UTC 2014


On Tue, Jun 17, 2014 at 6:39 AM, Andrew Wilkins <
andrew.wilkins at canonical.com> wrote:

> Hi all,
>
> I've started looking into fixing
> https://bugs.launchpad.net/juju-core/+bug/1215579. The gist is, we
> currently set private-address in relation settings when a unit joins, but
> never update it.
>
> I've had some preliminary discussions with John, William and Dimiter, and
> came up with the following proposal:
> https://docs.google.com/a/canonical.com/document/d/1jCNvS7sSMZqtSnup9rDo3b2Wwgs57NimqMorXr9Ir-o/edit
>
> If you're a charm author, particularly if you work on "proxy charms",
> please take a look at this and let me know of any concerns or suggestions.
> I have opened up comments on the doc.
>
> In a nutshell:
>  - There will be a new hook, relation-address-changed, and a new tool
> called address-get.
>  - The hook will be called when the relation's address has changed, and
> the tool can be called to obtain the address. If the hook is not
> implemented, the private-address setting will be updated. Otherwise it is
> down to you to decide how you want to react to address changs (e.g. for
> proxy charms, probably just don't do anything.)
>

I think that what the proposal says is subtly different: that is, that we
*will* update the private-address setting for that foo relation at the
start of the foo-relation-address-changed hook, but that it won't be
propagated further until that hook is committed.

The upshot is that if you're *not* a proxy charm, you can *probably* ignore
the relation-address-changed hook [0]; but if you *are* a proxy charm, you
must (almost) certainly overwrite the new private-address setting with that
of the endpoint you're proxying.

IMO this behaviour is more consistent and predictable than behaving
differently depending on whether or not a particular hook is implemented.

Cheers
William

[0] some interfaces have their own language -- say "host" -- and they'll
have to be responsible for updating themselves.

>
> Thanks,
> Andrew
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140617/977cae7e/attachment.html>


More information about the Juju-dev mailing list