Skip to content

Commit 7c5957f

Browse files
authored
Merge pull request containerd#66 from thehajime/fix-win-build
Fix a regression of windows build issue of undefined symbol
2 parents ad1414d + d6ba496 commit 7c5957f

File tree

3 files changed

+69
-16
lines changed

3 files changed

+69
-16
lines changed

runc.go

-16
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
"time"
3333

3434
specs "github.com/opencontainers/runtime-spec/specs-go"
35-
"golang.org/x/sys/unix"
3635
)
3736

3837
// Format is the type of log formatting options avaliable
@@ -55,21 +54,6 @@ const (
5554
DefaultCommand = "runc"
5655
)
5756

58-
// Runc is the client to the runc cli
59-
type Runc struct {
60-
//If command is empty, DefaultCommand is used
61-
Command string
62-
Root string
63-
Debug bool
64-
Log string
65-
LogFormat Format
66-
PdeathSignal unix.Signal
67-
Setpgid bool
68-
Criu string
69-
SystemdCgroup bool
70-
Rootless *bool // nil stands for "auto"
71-
}
72-
7357
// List returns all containers created inside the provided runc root directory
7458
func (r *Runc) List(context context.Context) ([]*Container, error) {
7559
data, err := cmdOutput(r.command(context, "list", "--format=json"), false)

runc_unix.go

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//+build !windows
2+
3+
/*
4+
Copyright The containerd Authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
package runc
20+
21+
import (
22+
"golang.org/x/sys/unix"
23+
)
24+
25+
// Runc is the client to the runc cli
26+
type Runc struct {
27+
//If command is empty, DefaultCommand is used
28+
Command string
29+
Root string
30+
Debug bool
31+
Log string
32+
LogFormat Format
33+
PdeathSignal unix.Signal
34+
Setpgid bool
35+
Criu string
36+
SystemdCgroup bool
37+
Rootless *bool // nil stands for "auto"
38+
}

runc_windows.go

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
Copyright The containerd Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package runc
18+
19+
// Runc is the client to the runc cli
20+
type Runc struct {
21+
//If command is empty, DefaultCommand is used
22+
Command string
23+
Root string
24+
Debug bool
25+
Log string
26+
LogFormat Format
27+
Setpgid bool
28+
Criu string
29+
SystemdCgroup bool
30+
Rootless *bool // nil stands for "auto"
31+
}

0 commit comments

Comments
 (0)