Skip to content

README.md, cmd/initContainer: Don't require /etc/machine-id in images#794

Merged
debarshiray merged 3 commits intocontainers:mainfrom
debarshiray:wip/rishi/mount-bind-handle-regular-files
Jun 22, 2021
Merged

README.md, cmd/initContainer: Don't require /etc/machine-id in images#794
debarshiray merged 3 commits intocontainers:mainfrom
debarshiray:wip/rishi/mount-bind-handle-regular-files

Conversation

@debarshiray
Copy link
Copy Markdown
Member

@debarshiray debarshiray commented Jun 21, 2021

Since /etc/machine-id is bind mounted into the toolbox container from
the host operating system, it doesn't make sense to make it mandatory
for images to have that file. Apparently, (some?) Arch Linux images
don't have /etc/machine-id.

Since a missing containerPath for a directory is handled the same way,
there's no reason not to do the same for regular files. It will make
life a bit easier for those creating toolbox images for different
distributions.

#710

@debarshiray debarshiray force-pushed the wip/rishi/mount-bind-handle-regular-files branch from 67291de to 1e3b388 Compare June 21, 2021 16:53
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build failed.

@martymichal martymichal added 2. Container Configuration Configuration of a container. Mounts, environmental variables, privileges. 2. Container Realm The issue is related to what happens inside of a toolbox container 3. Enhancement Improvement to an existing feature 6. Minor Change Should not cause breakage labels Jun 21, 2021
Copy link
Copy Markdown
Member

@martymichal martymichal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@debarshiray
Copy link
Copy Markdown
Member Author

Looks good to me.

Thanks for the review!

A subsequent commit will handle a missing containerPath when bind
mounting a regular file like /etc/machine-id. Therefore, it's better to
explicitly state that this code is dealing with a directory.

containers#710
Errors thrown from 'toolbox init-container' are usually not shown to
the user. One has to use 'podman start --attach ...' to see them.
Therefore, it's worth adding the extra bit of information to the error.

containers#710
Since /etc/machine-id is bind mounted into the toolbox container from
the host operating system, it doesn't make sense to make it mandatory
for images to have that file. Apparently, (some?) Arch Linux images
don't have /etc/machine-id.

Since a missing containerPath for a directory is handled the same way,
there's no reason not to do the same for regular files. It will make
life a bit easier for those creating toolbox images for different
distributions.

containers#710
@debarshiray debarshiray force-pushed the wip/rishi/mount-bind-handle-regular-files branch from 1e3b388 to fb41179 Compare June 22, 2021 00:31
@debarshiray debarshiray merged commit fb41179 into containers:main Jun 22, 2021
@debarshiray debarshiray deleted the wip/rishi/mount-bind-handle-regular-files branch June 22, 2021 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. Container Configuration Configuration of a container. Mounts, environmental variables, privileges. 2. Container Realm The issue is related to what happens inside of a toolbox container 3. Enhancement Improvement to an existing feature 6. Minor Change Should not cause breakage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants