Charmed-Kubernetes/keepalived/hooks/relations/juju-info
AnonSaber 114deb7b24 update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
..
docs update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
.gitignore update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
README.md update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
__init__.py update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
interface.yaml update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
make_docs update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
peers.py update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
provides.py update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
pydocmd.yml update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
requires.py update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00
tox.ini update:charmed-kubernetes-657 2023-04-10 07:52:07 +00:00

README.md

Juju-Info Interface

The juju info interface is a special and implicit relationship that works with any charm. It is mainly useful for subordinate charms that can add functionality to any exisiting machine without the host charm being aware of it.

Flags

{{endpoint_name}}.connected

Note: This flag keys off of what the charm author names the relationship endpoint, which should not be the name of the interface:

An example of a properly implemented relationship would resemble the following:

requires:
  host-system:
    interface: juju-info

This might then be used in your charm would like:

@when_any('host-system.connected')
def handle_host():
    host = endpoint_from_flag('host-system.connected')
    for address in host.addresses:
        hookenv.log('Connected to: {}'.format(address))

Reference