operator icon indicating copy to clipboard operation
operator copied to clipboard

Test harness relations missing Juju managed data

Open stub42 opened this issue 5 years ago • 4 comments

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.

stub42 avatar Nov 23 '20 09:11 stub42

Is there any reasonable default that could be populated by the harness itself?

chipaca avatar Nov 23 '20 10:11 chipaca

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.

stub42 avatar Nov 23 '20 14:11 stub42

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 .

jameinel avatar Nov 23 '20 15:11 jameinel

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.

dstathis avatar Sep 21 '21 05:09 dstathis