Charmed-Kubernetes/keepalived/hooks/relations/juju-info
xiafan 35f601a2a0 update kubernetest 1.22 2023-06-29 14:22:27 +08:00
..
docs update kubernetest 1.22 2023-06-29 14:22:27 +08:00
.gitignore update kubernetest 1.22 2023-06-29 14:22:27 +08:00
README.md update kubernetest 1.22 2023-06-29 14:22:27 +08:00
__init__.py update kubernetest 1.22 2023-06-29 14:22:27 +08:00
interface.yaml update kubernetest 1.22 2023-06-29 14:22:27 +08:00
make_docs update kubernetest 1.22 2023-06-29 14:22:27 +08:00
peers.py update kubernetest 1.22 2023-06-29 14:22:27 +08:00
provides.py update kubernetest 1.22 2023-06-29 14:22:27 +08:00
pydocmd.yml update kubernetest 1.22 2023-06-29 14:22:27 +08:00
requires.py update kubernetest 1.22 2023-06-29 14:22:27 +08:00
tox.ini update kubernetest 1.22 2023-06-29 14:22:27 +08: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