move WithCDI to pkg/cri/opts

As WithCDI is CRI-only API it makes sense to move it
out of oci module.

This move can also fix possible issues with this API when
CRI plugin is disabled.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
This commit is contained in:
Ed Bartosh
2022-10-12 12:21:19 +03:00
parent e6b5311508
commit eec7a76ecd
6 changed files with 41 additions and 41 deletions

View File

@@ -404,7 +404,7 @@ func (c *criService) containerSpecOpts(config *runtime.ContainerConfig, imageCon
specOpts = append(specOpts, seccompSpecOpts)
}
if c.config.EnableCDI {
specOpts = append(specOpts, oci.WithCDI(config.Annotations, c.config.CDISpecDirs))
specOpts = append(specOpts, customopts.WithCDI(config.Annotations, c.config.CDISpecDirs))
}
return specOpts, nil
}