Enforce 'optional: false' in metadata.yaml
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Won't Fix
|
Low
|
Unassigned |
Bug Description
metadata.yaml allows a charm to specify 'optional: false' in its metadata.yaml file. This is not enforced by Juju (and documented as such). Now we have service status, we could keep the units in 'blocked' status until all required relations have been added.
This would improve visibility to end users, as they can see why things are blocked and how to proceed.
Note that charms cannot do this correctly themselves. For a charm to encode this logic, the best it can do is to introspect its relations in its config-changed, *-relation-joined and *-relation-broken hooks and set the blocked status there. This isn't technically correct, as the charm doesn't know if the relation needs to be added or if it just hasn't been joined yet. It has no way of knowing if the status should be waiting (waiting for the relation hooks to run), or blocked (waiting for the relation to be added by the operator). Blocked is the best choice for this work around, as the incorrect status will be fixed automatically once the hooks have run, as opposed to leaving the service in a waiting state indefinitely and telling the user things are progressing when they have actually stalled.
tags: | added: charm |
Changed in juju-core: | |
importance: | Wishlist → Low |
status: | New → Triaged |
tags: | added: enhancement |
tags: |
added: improvement removed: enhancement |
Changed in juju-core: | |
status: | Triaged → Won't Fix |
I don't think this should be enforced, with status-set in 1.24 charm logic can much better convey this to it's users.