-
Notifications
You must be signed in to change notification settings - Fork 267
runroot: add check that it is on volatile storage #317
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
Conversation
04ce96b to
6c4cf83
Compare
|
LGTM |
vrothberg
left a comment
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.
The logic LGTM but I think we need the check in multiple paths. Maybe we can add an internal (s *store) validate() error func?
6c4cf83 to
4bf47bf
Compare
|
@giuseppe This breaks tests. I think you will to mount a tmpfs on local storage to get this to pass. I wonder if this will break CI/CD Systems when we test also. Should we have a way to ignore this test. |
4bf47bf to
fc244d6
Compare
store.go
Outdated
| if onTmpfs, err := mount.IsOnVolatileStorage(runRoot); err != nil || !onTmpfs { | ||
| if err != nil { | ||
| return errors.Wrapf(err, "cannot check if %s is on tmpfs", runRoot) | ||
| } else { |
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.
Nit: No need for the else, just keep the return line.
4a1e4fc to
797c7ad
Compare
TomSweeneyRedHat
left a comment
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.
LGTM
|
CI is not yet happy: |
797c7ad to
77a5f90
Compare
|
@giuseppe Could you set up a WIP vendor of this patch into libpod and make sure the CI system passes. |
|
opened here: containers/podman#2976 |
CI is not running on a tmpfs :^) |
|
This is also going to cause issues with running containers within containers, will now require /run have a tmpfs mounted on /run |
77a5f90 to
c566b2f
Compare
I've pushed a new version where it is possible to disable this check. I've also updated the WIP PR for podman to set it correctly when the "container" environment variable is set |
c566b2f to
6518b34
Compare
6518b34 to
20b8545
Compare
pkg/mount/mountinfo_linux.go
Outdated
| (11) super options: per super block options*/ | ||
| mountinfoFormat = "%d %d %d:%d %s %s %s %s" | ||
|
|
||
| TMPFS_MAGIC = 0x1021994 |
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.
Should probably reuse github.com/containers/storage/drivers.FsMagicTmpfs and the adjacent GetFSMagic() function here.
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.
should I move these functions to github.com/containers/storage/drivers? Otherwise it introduces an import cycle.
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.
Maybe pkg/util?
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.
Never mind that does not exists.
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.
Seems to make sense.
20b8545 to
fae4ed4
Compare
Make sure the runroot won't persist after a reboot, if it happens then we can carry wrong information on the current active mounts. Closes: containers/podman#2150 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
fae4ed4 to
3c4f600
Compare
|
LGTM, with one nit: we appear to be checking the location if one is specified in the configuration file, but not if one isn't. If that's intended, then it's fine. |
|
This still concerns me for the buildah inside of a podman container case, or inside of a docker or other container runtime. We need a mechanism to figure out whether we are running inside of a container. Does Docker always set the |
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
|
docker doesn't seem to set that. I am going to close this PR for now, as it probably introduces more issues than it solves |
Make sure the runroot won't persist after a reboot, if it happens then
we can carry wrong information on the current active mounts.
Closes: containers/podman#2150
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com