consul-k8s icon indicating copy to clipboard operation
consul-k8s copied to clipboard

fix permissions for /consul/extra-config

Open eb4x opened this issue 3 years ago • 3 comments

On openshift/okd you might not have permissions to create directories everywhere. But you can introduce mounts.

Here we're just creating insignificant mount-points for the extra-config to do it's thing, thus eliminating the need for creating the directory, which the user running the container might not have permissions to do.

Fixes #1306

eb4x avatar Jun 25 '22 12:06 eb4x

Thank you so much @eb4x! Could you add bats test to verify the existence of the volume and volume mounts for both client-daemonset.bats and server-statefulset.bats?
The documentation for adding bats tests is here: https://github.com/hashicorp/consul-k8s/blob/main/CONTRIBUTING.md#writing-unit-tests

An example of testing for the existence of a volume and a volume mount is here: https://github.com/hashicorp/consul-k8s/blob/main/charts/consul/test/unit/client-daemonset.bats#L1738-L1758

jmurret avatar Jun 27 '22 17:06 jmurret

With the introduction of a new volume, I broke some tests which were dependent on volumes arranged in a fixed order, I can cherry-pick the fix in question provided from #1313, or maybe PR #1313 can get reviewed and merged first.

eb4x avatar Jun 30 '22 11:06 eb4x

Hi @eb4x! Thanks for submitting this PR, I was taking a quick look at it today and noticed that our CI did not run against it yet and so before approving I wanted to be sure it passed our acceptance tests. Right now it is failing the snapshot_agent test and I'm not immediately sure why, but if you have a chance to take a look that would be great. I'll circle back to this and look as well soon. Cheers.

kschoche avatar Jul 06 '22 21:07 kschoche