Add support for CDI device configuration

- Persist CDIDevices in container config
- Add e2e test
- Log HasDevice error and add additional condition for safety

Signed-off-by: Sebastian Jug <seb@stianj.ug>
This commit is contained in:
Sebastian Jug
2021-03-29 20:21:00 -04:00
parent cf2c3a1f13
commit db7cff8c86
13 changed files with 628 additions and 0 deletions

View File

@ -293,6 +293,17 @@ func WithHooksDir(hooksDirs ...string) RuntimeOption {
}
}
// WithCDI sets the devices to check for for CDI configuration.
func WithCDI(devices []string) CtrCreateOption {
return func(ctr *Container) error {
if ctr.valid {
return define.ErrCtrFinalized
}
ctr.config.CDIDevices = devices
return nil
}
}
// WithDefaultMountsFile sets the file to look at for default mounts (mainly
// secrets).
// Note we are not saving this in the database as it is for testing purposes