canonical / admission-webhook-operator

Admission Webhook Operator
Apache License 2.0
1 stars 4 forks source link

fix: defer pebble ready event if container is not ready #116

Closed DnPlas closed 11 months ago

DnPlas commented 11 months ago

Deferring the pebble ready event will ensure that the required operations that need to happen before starting the service are in place. In this case, certificate files need to be present in the container, but sometimes the container is not reachable, causing the action of pushing these files to the container impossible. In the past we returned if the container was not reachable, but never tried to reach out to it and push the files, this commit ensures the retry via defer.

Fixes #110

TODO:

i-chvets commented 11 months ago

LGTM. The only concern is that there is a possibility of other event to come in and be processed by charm before Pebble Ready event is handled. Eg. Update Status event. Not sure if it is worth it to simulate this behaviour in tests.