On 22/05/17 18:23, roger peppe wrote: > I think it's slightly unfortunate that update-status exists at all - > it doesn't really need to, > AFAICS, as a charm can always do the polling itself if needed; for example: > > while :; do > sleep 30 > juju-run $UNIT 'status-set current-status "this is what is > happening"' > done & > > Or (better) use juju-run to set the status when the workload > executable starts and exits, avoiding the need for polling at all. >
It's not sufficient to just set the status when the workload starts and exits. One example is a database which periodically goes offline for a short time for maintenance. The workload executable itself should not have to know how to communicate this to Juju. By the agent running update-status hook periodically, it allows the charm itself to establish whether the database status should be marked as "maintetance" for example. Using a hook provides a standard way all charms can rely on to communicate workload status in a consistent way. -- Juju-dev mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
