canonical / oidc-gatekeeper-operator

Charmed OIDC Gatekeeper
Apache License 2.0
0 stars 7 forks source link

feat: Implement health checks & on_update_status #134

Open orfeas-k opened 5 months ago

orfeas-k commented 5 months ago

Implementation

This PR adds:

For implementation decisions about the health check and tests, please take a look at the issues being closed.

This PR uses for testing PR https://github.com/canonical/charmed-kubeflow-chisme/pull/88 and for the charm PR https://github.com/canonical/charmed-kubeflow-chisme/pull/85. They should be merged to main and either release new chisme and unpin chisme or pin to main branch in both requirements*.in files. Otherwise, this will break once we merge and branches are deleted.

Testing

In order to verify that charm reflects the workload's health status, you can deploy the charm configured with a dummy URL that is not reachable. This should result in the workload not being healthy and that should be reflected in the charm's status once an update-status event is fired.

juju deploy oidc-gatekeeper --channel latest/edge/pr-134 --trust --base ubuntu@20.04 --config public-url=http://wrong-url
### wait 40 seconds in order for workload health check to go down `(threshold * (period + timeout))`
sleep 40
jhack fire oidc-gatekeeper/0 update-status
juju status

Closes #82 Closes #130