X Tutup
Skip to content

Commit ea00fc7

Browse files
committed
Remove protobuf for mount in shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
1 parent ba61af6 commit ea00fc7

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

linux/proc/types.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
package proc
22

33
import (
4-
containerd_types "github.com/containerd/containerd/api/types"
54
google_protobuf "github.com/gogo/protobuf/types"
65
)
76

7+
type Mount struct {
8+
Type string
9+
Source string
10+
Target string
11+
Options []string
12+
}
13+
814
// CreateConfig hold task creation configuration
915
type CreateConfig struct {
1016
ID string
1117
Bundle string
1218
Runtime string
13-
Rootfs []*containerd_types.Mount
19+
Rootfs []Mount
1420
Terminal bool
1521
Stdin string
1622
Stdout string

linux/shim/service.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ type Service struct {
9595
func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (*shimapi.CreateTaskResponse, error) {
9696
s.mu.Lock()
9797
defer s.mu.Unlock()
98+
99+
var mounts []proc.Mount
100+
for _, m := range r.Rootfs {
101+
mounts = append(mounts, proc.Mount{
102+
Type: m.Type,
103+
Source: m.Source,
104+
Target: m.Target,
105+
Options: m.Options,
106+
})
107+
}
98108
process, err := proc.New(
99109
ctx,
100110
s.config.Path,
@@ -108,7 +118,7 @@ func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (*sh
108118
ID: r.ID,
109119
Bundle: r.Bundle,
110120
Runtime: r.Runtime,
111-
Rootfs: r.Rootfs,
121+
Rootfs: mounts,
112122
Terminal: r.Terminal,
113123
Stdin: r.Stdin,
114124
Stdout: r.Stdout,

0 commit comments

Comments
 (0)
X Tutup