RFC: state entities, replace globalKey() with .Tag().String()

Jesse Meek jesse.meek at canonical.com
Wed Sep 24 04:13:10 UTC 2014


Brilliant. +1

On 24/09/14 15:53, Tim Penhey wrote:
> Hi folks,
>
> I have been going through much of the code in the state package looking
> at the work to migrate all the collection keys to handle multiple
> environments.
>
> In the long and distant past (earlier this year), the Tag() method
> returned a string.  There is a second tag like thing in the state
> package called the "globalKey". This is used as a collection independent
> key into annotations, presence, settings, networks and status.  It seems
> that the only things we ever use for this are entities that have their
> own tag types.
>
> If we ignore actions (which I don't think should bother implementing
> globalKey), then we are talking about: machine, service, unit, and network.
>
> I propose that we replace all occurrences of the globalKey with a string
> representation of the Tag for that entity.
>
> One good part of this, is that for any element of the other collections,
> we can use the existing state.FindEntity(tag names.Tag) function.
>
> Is anyone opposed to this change?
>
> Cheers,
> Tim
>




More information about the Juju-dev mailing list