fix(startup): only modifying logrotate configs when they are writable#266
Conversation
|
Need to test this before marking as ready for review, but this PR should take care of read-only mounted logrotate.confs. |
|
Tested PR with locally built image in our Kubernetes environment, where it was crashing on logrotate.conf modifications before - now it's working! |
|
Another approach would be to mount the configmap logrotate.conf to something like @bokysan what do you think/prefer? |
|
As a workaround, I also tried to just override I'm wondering if this is actually necessary? |
logrotate.conf might be mounted from a Kubernetes ConfigMap, in which case - /etc/logrotate.d/logrotate.conf - inline sed replacements for removing duplicate mail.log lines are skipped - responsibility for correctness is with user
0ae0dd2 to
e016044
Compare
|
Hi, sorry for the late reply -- I will check out your commit ASAP. |
|
Does it work on both Alpine and Debian? If so I think we can merge it. |
|
We're currently running the Debian based image built from this MR in our infra - I'll quickly test with Alpine as well! |
|
Yes, both Alpine and Debian based images work! |
|
Merged. Let's see how it pans out. Thank you so much for all the great work! |
|
Can you trigger a 5.1.1 release for this, or do you want to wait for other features as well? |
logrotate.conf might be mounted from a Kubernetes ConfigMap, in which case
For consistency, I added the same check for
/etc/logrotate.d/rsyslog.Fixes #263