-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bitnami/elasticsearch] do not fail if asked to chown read-only files #77526
base: main
Are you sure you want to change the base?
Conversation
7f88251
to
35f8413
Compare
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution @ianroberts. I'm sorry for the late response.
I would like to suggest two changes to your contribution:
- You used
|| :
, but we prefer using|| true
. - You added both
|| :
and-f
option for chown, which is redundant. The option-f
suppresses both error exit-code and messages, while the|| :
would supress the exit code. I would suggest not using-f
, since hiding error message could make troubleshooting really complicated in some cases.
bitnami/elasticsearch/8/debian-12/rootfs/opt/bitnami/scripts/libelasticsearch.sh
Outdated
Show resolved
Hide resolved
bitnami/elasticsearch/8/debian-12/rootfs/opt/bitnami/scripts/libelasticsearch.sh
Outdated
Show resolved
Hide resolved
Added "|| true" to chown commands so they do not cause the container startup to fail if any of the target folders or their subdirectories are mounted from a read-only filesystem Signed-off-by: Ian Roberts <[email protected]>
35f8413
to
2a9bd60
Compare
Very sensible suggestions, I've implemented them and rebased on the latest main branch. |
My first attempt just used the |
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 |
Description of the change
Add
|| true
tochown
commands that operate recursively on folders that are expected to be mounted into the container from volumes or bind mounts, so that thechown
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
Additional information
This fix should probably be applied before bitnami/charts#31960 is merged.