> > It may be worth having a FilterRoleEndpoints function, which behaves
> > like RemoveRoleEndpoints, but accepts a func(*InputEndpoint) bool
> > function which can either mutate the endpoint or remove it (by
> > returning false). I think this might better support the desired
> > behaviour in juju-core, and make us more flexible to change.
>
> Seems a bit overkill *if* we can figure out what the "natural key" of an
> endpoint is…
I did it, and it was a good move, imo. The filterRoleEndpoints
function is not public, and is only called by RemoveRoleEndpoints, but
splitting up the function has made testing and reasoning easier.
Don't dismiss divide and conquer :)
> > It may be worth having a FilterRoleEndpoints function, which behaves ints, but accepts a func(*InputEndp oint) bool
> > like RemoveRoleEndpo
> > function which can either mutate the endpoint or remove it (by
> > returning false). I think this might better support the desired
> > behaviour in juju-core, and make us more flexible to change.
>
> Seems a bit overkill *if* we can figure out what the "natural key" of an
> endpoint is…
I did it, and it was a good move, imo. The filterRoleEndpoints ints, but
function is not public, and is only called by RemoveRoleEndpo
splitting up the function has made testing and reasoning easier.
Don't dismiss divide and conquer :)