Descriptionadd RelationContext type
The RelationContext manages a single relation's unit settings, as a step
towards implementing relation-aware jujuc commands. It exposes features that
will be used directly by the relation-get, relation-set, relation-list and
relation-ids commands; the interface is designed to allow convenient
creation from uniter.RelationState instances, and convenient updates from
uniter.HookInfo values.
This doesn't yet fit cleanly with the ClientContext type, but integrating
the types will have somewhat noisy consequences, so the RelationContext is
currently exercised alone. Expect an imminent followup integrating
RelationContext into ClientContext as follows:
drop LocalUnitName string; add Unit *state.Unit
drop RelationName string; add RelationId int
keep RemoteUnitName
add Relations map[int]*RelationContext, keyed on relation id
...and:
change name to HookContext
We expect every HookContext to contain full details of all relations the
unit is currently participating in, in Relations; this is needed to allow
commands like relation-ids and relation-list to run regardless of context.
The relation-specific JUJU_RELATION and JUJU_RELATION_ID environment
variables (along with JUJU_REMOTE_UNIT where apropriate) would be set when
RelationId were valid (ie it must not be -1, and it must bea valid key into
Relations).
https://code.launchpad.net/~fwereade/juju-core/jujuc-server-relation-context/+merge/117202
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : add RelationContext type #
Total comments: 17
Patch Set 3 : add RelationContext type #
Total comments: 8
Patch Set 4 : add RelationContext type #
Total comments: 4
Patch Set 5 : add RelationContext type #
MessagesTotal messages: 8
|