-
Notifications
You must be signed in to change notification settings - Fork 585
Throw error when starting a container with invalid virtiofs source #1051
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
base: main
Are you sure you want to change the base?
Conversation
2841247 to
b7f738d
Compare
|
Seeing this test failure: |
|
Previous failures may have affect the following ones. Below is the failing test cases in git action. Could we try testing again to check it reproduces the same? |
Run = Create + Start
1) Mount source points to a valid directory
- Run and Create + Start both correctly create the container with
mount.
2) Mount source points to a file
- Run fails bootstrapping the container, thus container not created.
- Create creates the container, but Start fails bootstrapping,
removing the container.
(Thus, both are the same.)
3) Mount source deleted or replaced to file after container created
- Start throw errors but do not delete the container.
b7f738d to
e840b77
Compare
|
Integration test succeeded on my Mac. |
| for mount in container.configuration.mounts where mount.isVirtiofs { | ||
| if !FileManager.default.fileExists(atPath: mount.source) { | ||
| throw ContainerizationError(.invalidState, message: "path '\(mount.source)' is not a directory") | ||
| } | ||
| } |
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.
Is it possible for us to do this in bootstrap in the API server instead?
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.
It could be, but it might be duplicated as ClientCreate and ClientRun checks the mount source also.
Current bootstrap implicitly does it as making VM throws an error due to the wrong mount source path.
The thing is then, the container is just removed forever due to the cleanup logic.
|
It seems RunCommand fails randomly due to the XPC timeout when creating the container, but API server actually created the container internally. Since the container is not cleaned up in the earlier test, image prune fails as alpine image is not dangling. |
Run = Create + Start
Mount source points to a valid directory
Mount source points to a file
Mount source deleted or replaced to file after container created
Type of Change
Motivation and Context
User can encounter unexpected container removal when shared volume source is in wrong state.
Testing