[bitnami/elasticsearch] do not fail if asked to chown read-only files
Description of the change
Add || true to chown commands that operate recursively on folders that are expected to be mounted into the container from volumes or bind mounts, so that the chown does not cause a fatal error if any of the target directories or their children are mounted read-only.
Benefits
Currently when running as root the elasticsearch container will fail to start if any folder under /opt/bitnami/elasticsearch/config is mounted from a read-only filesystem. In particular this happens in the corresponding bitnami Helm chart, where the TLS certificates for Elasticsearch are mounted in from a Kubernetes secret. This change means that such cases are no longer fatal errors - the files in the read-only filesystems will not of course have their ownership changed, but there's not really anything better we can do if the filesystem is read-only.
Possible drawbacks
If a mounted filesystem should have been read-write but was mounted read-only by mistake, it would previously have caused a fatal error, prompting the user to change their configuration; this change will make that a no-op so they might not notice.
Applicable issues
- fixes #77525
Additional information
This fix should probably be applied before https://github.com/bitnami/charts/pull/31960 is merged.
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.
Still relevant.
Very sensible suggestions, I've implemented them and rebased on the latest main branch.
- You added both
|| :and-foption for chown, which is redundant. The option-fsuppresses both error exit-code and messages, while the|| :would supress the exit code.
My first attempt just used the -f but it turns out that -f suppresses the messages but does not on its own affect the exit code. So I added the || : (now || true) as well to actually fix the issue.
Still waiting for final review.
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.
Not stale, still waiting for final approval by @migruiz4
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.
Not stale. I addressed the review comments six weeks ago on 11th March but my fixes are still awaiting final approval. Please could someone look at this soon as I have another PR on the helm chart that is blocked waiting for this one.
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.
Not stale. I addressed the review comments six weeks ago on 11th March but my fixes are still awaiting final approval. Please could someone look at this soon as I have another PR on the helm chart that is blocked waiting for this one.
Eight weeks.
@carrodher if @migruiz4 is no longer available to handle this, would you be able to assign someone else?
Sorry for the delay, this PR was somehow out of our radar. Could you please move the changes to the elasticsearch/9/debian-12 folder, which is the one available in Bitnami at this moment? Thanks
Rebased, but the delay is slightly unfortunate if it means there will never be a fixed container released for any Elasticsearch in the 8.x series 😞
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.
Not stale - rebased as requested, awaiting final review.
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.
Rebased a month ago as requested, still waiting for approval and merge.
Hope this gets priority soon, and #31960 as well. Not having auto reload on certificate renewal is a critical problem.
Do you know when an image including this fix is likely to be available on Docker hub? I need to update https://github.com/bitnami/charts/pull/31960 with the fixed image tag before that one can be merged.
The fix was included in the latest released image bitnami/elasticsearch:9.0.3-debian-12-r1