mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-27 11:31:05 +00:00
gpu: Add CDI parsing for Sandbox as well
Extend the CDI parsing for pod_sandbox as well, only single_container was covered properly. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
parent
97f4bcb456
commit
6713db8990
@ -112,19 +112,16 @@ func create(ctx context.Context, s *service, r *taskAPI.CreateTaskRequest) (*con
|
||||
if s.sandbox != nil {
|
||||
return nil, fmt.Errorf("cannot create another sandbox in sandbox: %s", s.sandbox.ID())
|
||||
}
|
||||
// Here we deal with CDI devices that are cold-plugged (k8s) and
|
||||
// for the single_container (nerdctl, podman, ...) use-case.
|
||||
// We can provide additional directories where to search for
|
||||
// CDI specs if needed. immutable OS's only have specific
|
||||
// directories where applications can write too. For instance /opt/cdi
|
||||
//
|
||||
// _, err = withCDI(ociSpec.Annotations, []string{"/opt/cdi"}, ociSpec)
|
||||
//
|
||||
// Only inject CDI devices if single_container we do not want
|
||||
// CDI devices in the pod_sandbox
|
||||
if containerType == vc.SingleContainer {
|
||||
_, err = config.WithCDI(ociSpec.Annotations, []string{}, ociSpec)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("adding CDI devices failed: %w", err)
|
||||
}
|
||||
_, err = config.WithCDI(ociSpec.Annotations, []string{}, ociSpec)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("adding CDI devices failed: %w", err)
|
||||
}
|
||||
|
||||
s.config = runtimeConfig
|
||||
|
Loading…
Reference in New Issue
Block a user