Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

B OpenNebula/one#6174: Consider /etc/hosts being empty #297

Merged
merged 2 commits into from
May 26, 2023
Merged

Conversation

dann1
Copy link
Collaborator

@dann1 dann1 commented May 25, 2023

populating /etc/hosts fails on DockerHub images because the file exists, but it is empty. So this condition triggers

elif [ -f /etc/hosts ]; then
        # In FreeBSD, sed doesn't interpret \n. We put a real newline.
        eval "${SED_I} -e \"1s/^/${entry}\"$'\\\\\n/' /etc/hosts"

and nothing happens. Now it is -s which will check both that the file exists and is not empty. When empty, next condition (else) will be checked and the entry will be forcibly written.

Some linting as well

Closes OpenNebula/one#6174

No doc PR required since it is a context problem. When the release is made it will be added to the context changelog

@dann1 dann1 requested review from tinova and rsmontero May 25, 2023 22:23
@rsmontero rsmontero merged commit 40459a5 into master May 26, 2023
@rsmontero rsmontero deleted the b-6174 branch May 26, 2023 21:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing contextualization configuration in FireCracker VMs
2 participants