canonical / istio-operators

Charmed Istio
2 stars 17 forks source link

Update `Permission denied` exception in charm and test code #420

Open DnPlas opened 4 months ago

DnPlas commented 4 months ago

Context

401 introduces the use of user secrets for configuring the TLS ingress Gateway, but because of https://github.com/canonical/operator/issues/1229 and https://bugs.launchpad.net/juju/+bug/2067336, the behaviour of the exception that gets raised when access to a secret hasn't been granted is inconsistent. We are not holding #401 any more from being merged, so we have to make sure we come back and change the istio-pilot charm code and unit test accordingly.

What needs to get done

  1. Update the test_use_https_with_tls_secret_permission_denied unit test code with an assertion that checks the message on the described scenario
  2. Update the _use_https_with_tls_secret method in the charm code to catch the right exception (seems like it'll be the SecretNotFound exception) and handle it accordingly

Definition of Done

The _use_https_with_tls_secret method gets tested with test_use_https_with_tls_secret_permission_denied with the actual Juju behaviour after https://bugs.launchpad.net/juju/+bug/2067336 is fixed.

syncronize-issues-to-jira[bot] commented 4 months ago

Thank you for reporting us your feedback!

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

This message was autogenerated