To make sure all required directories have all required permissions, no matter the file system defaults of the cloud it is deployed to, we will initialize the directory structure on startup and create the directories with the required permissions within the container.
Issue
The fix in https://github.com/canonical/redis-k8s-operator/pull/91 for issue https://github.com/canonical/redis-k8s-operator/issues/90 did not solve the problem, as the Juju-created storage volume is obviously mounted on top of the existing directory on the image.
Solution
To make sure all required directories have all required permissions, no matter the file system defaults of the cloud it is deployed to, we will initialize the directory structure on startup and create the directories with the required permissions within the container.