Test harness relations missing Juju managed data
The ingress-address and egress-subnets relation data is maintained by Juju, and often required. The Operator Framework test harness does not initialize this information when doing harness.add_relation_unit(), so relation-joined handlers can fail due to missing relation data that should always be there.
Is there any reasonable default that could be populated by the harness itself?
Dummy values could be set, random-but-stable IP addresses or just completely random would work.
Alternatively, a way for the charm author to initialize them via add_relation_unit (to ensure they are set during relation-joined hooks) would be enough.
Or defer until we know how the harness is handling other network information, since the relation data really should match what is returned by network-get.
I think we have an open issue for modeling networking generally, but we can take this as a focused piece of that puzzle.
On Mon, Nov 23, 2020 at 9:32 AM Stub [email protected] wrote:
Dummy values could be set, random-but-stable IP addresses or just completely random would work.
Alternatively, a way for the charm author to initialize them via add_relation_unit (to ensure they are set during relation-joined hooks) would be enough.
Or defer until we know how the harness is handling other network information, since the relation data really should match what is returned by network-get.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/canonical/operator/issues/456#issuecomment-732199286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABRQ7J7RFV24FQP762TTRTSRJXBFANCNFSM4T7IGCFQ .
I'd like to bump this. I am currently using this data in one of my charm libraries and would love not to have to set it automatically.