Skip to content

Commit 40be96e

Browse files
committed
Have separate spec builder for each platform
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent fdfa351 commit 40be96e

21 files changed

Lines changed: 1072 additions & 732 deletions

oci/spec_opts_windows.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,10 @@ func WithHostDevices(_ context.Context, _ Client, _ *containers.Container, s *Sp
4545
func DeviceFromPath(path string) (*specs.LinuxDevice, error) {
4646
return nil, errors.New("device from path not supported on Windows")
4747
}
48+
49+
// WithDevices does nothing on Windows.
50+
func WithDevices(devicePath, containerPath, permissions string) SpecOpts {
51+
return func(ctx context.Context, client Client, container *containers.Container, spec *Spec) error {
52+
return nil
53+
}
54+
}

pkg/cri/opts/container.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ import (
2525
goruntime "runtime"
2626
"strings"
2727

28+
"github.com/containerd/continuity/fs"
29+
2830
"github.com/containerd/containerd"
2931
"github.com/containerd/containerd/containers"
3032
"github.com/containerd/containerd/errdefs"
3133
"github.com/containerd/containerd/log"
3234
"github.com/containerd/containerd/mount"
3335
"github.com/containerd/containerd/snapshots"
34-
"github.com/containerd/continuity/fs"
3536
)
3637

3738
// WithNewSnapshot wraps `containerd.WithNewSnapshot` so that if creating the

0 commit comments

Comments
 (0)