Charmed-Kubernetes/keepalived/hooks/relations/juju-info
XiaFan 654e782025 update keepalived mod 2023-04-11 14:53:55 +08:00
..
docs update keepalived mod 2023-04-11 14:53:55 +08:00
.gitignore bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
README.md bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
__init__.py bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
interface.yaml bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
make_docs bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
peers.py bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
provides.py bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
pydocmd.yml bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
requires.py bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +00:00
tox.ini bugfix:charmed-kubernetes-657 2023-04-10 07:39:20 +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