-
Notifications
You must be signed in to change notification settings - Fork 41
Support for making multiple overlays in the same scratch path #383
Conversation
* The work and upper dirs were hardcoded previously so if you had tried to create more than one overlay in a mountpoint (/dev/sda / container scratch volume) it would fail. This change just adds a simple check to see if workdir and upperdir already exist and will create a unique name for them with a generated ID. This is the same method cri uses to generate container IDs. Signed-off-by: Daniel Canter <[email protected]>
6368b0b
to
1637dcb
Compare
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
This is basically so that two callers can call |
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. nit: not sure if making a utility function is worth it (to dedupe)
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.
Have concerns with this design (see my other comment)
Correct, but by unique path do you mean where in the scratch space we would setup the upper/work dirs? Obviously we don't have anything in the CombinedLayers call to specify what we'd like the upper and work dirs to be named so I assume you mean specify a unique scratch path (Maybe just the path to the containers scratch space we're sharing/<container_id> would be good). We could verify this in the shim if the refcount on the scratch scsi disk is > 1, and then we can set the scratch path to whatever format we devise. Thoughts? @kevpar |
@kevpar For example, instead of this currently:
We could have:
|
Yes, I think the caller of the combine layers modify operation should be responsible for passing a correct directory to use. The As for what is the correct place to determine this, and what the paths should be, I'm not sure. As this work to re-use a scratch VHD for several containers spans several components, it might be helpful to write up an issue in |
already exist and will create a unique name for them with a generated ID. This is the same method cri uses to generate container IDs.
Signed-off-by: Daniel Canter [email protected]