canonical / observability-libs

A collection of charm libraries curated by the Observability team.
https://charmhub.io/observability-libs
Apache License 2.0
3 stars 8 forks source link

Cert_handler fails on scale down #105

Open nsklikas opened 1 month ago

nsklikas commented 1 month ago

Bug Description

On the glauth charm, we are using the cert_handler. It looks like there is a bug when scaling down the application see here.

Tbh it feels weird calling `_generate_csr to remove a certificate. I think that the function is overloaded and should be broken down.

To Reproduce

juju deploy glauth-k8s juju deploy postgresql-k8s juju deploy self-signed-certificates juju integrate postgresql-k8s glauth-k8s juju integrate self-signed-certificates glauth-k8s juju scale-application glauth-k8s 3

wait for deployment to stabilize

juju status juju scale glauth-k8s 1

Environment

juju 3.4

Relevant log output

unit-glauth-k8s-1: 13:48:48 INFO juju.worker.uniter awaiting error resolution for "relation-broken" hook
unit-glauth-k8s-2: 13:48:49 INFO juju.worker.uniter awaiting error resolution for "relation-broken" hook
unit-glauth-k8s-2: 13:48:50 ERROR juju.worker.uniter.context cannot apply changes: removing secrets: secret "secret://b8611322-e35c-4f87-843b-f03924ac4fcc/cqqv84nmp25c77sasjt0" not found
unit-glauth-k8s-2: 13:48:50 ERROR juju.worker.uniter.operation hook "certificates-relation-broken" (via hook dispatching script: dispatch) failed: removing secrets: secret "secret://b8611322-e35c-4f87-843b-f03924ac4fcc/cqqv84nmp25c77sasjt0" not found

Additional context

No response