From db7cff8c86a35a4b1971c3fbb2365eff9cc205d4 Mon Sep 17 00:00:00 2001 From: Sebastian Jug Date: Mon, 29 Mar 2021 20:21:00 -0400 Subject: 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 --- libpod/options.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libpod/options.go') diff --git a/libpod/options.go b/libpod/options.go index 5cd0f7b88..103a9a80a 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -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 -- cgit v1.2.3-54-g00ecf