canonical / charmed-kubeflow-chisme

Shared Utilities used across Charmed Kubeflow
Apache License 2.0
1 stars 4 forks source link

Get relation data from provides or required side of relation #116

Closed rgildein closed 2 weeks ago

rgildein commented 2 weeks ago

Context

Right now, the _get_app_relation_data and the _get_unit_relation_data are getting relation data from relation and endpoint defined in the charm. So if charm has "logging" endpoint defined in requires relations, those function will return application/unit data defined in required side of relation.

In our case, we need to get unit relation data from provides side of "logging" relation, so that's why assert_logging needs to be called with Grafana agent.

It is not very user-friendly, since all other assert functions are called with tested app, that's why I think we should add option to get application/unit data from either side of relation.

Calling assert_logging with tested app will also prevent raising an exception if grafana-agent-k8s is related with multiple application with logging endpoint.

What needs to get done

  1. assert_logging should be called with tested app, instead of Grafana agent
  2. _get_app_relation_data and _get_unit_relation_data should be able to get data from both side of relation

Definition of Done

  1. _get_app_relation_data and _get_unit_relation_data has argument for choosing side of relation
  2. the functionality is tested
syncronize-issues-to-jira[bot] commented 2 weeks ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-5974.

This message was autogenerated