Closed DnPlas closed 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.
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: