Skip to content

Commit

Permalink
Merge pull request #66 from thehajime/fix-win-build
Browse files Browse the repository at this point in the history
Fix a regression of windows build issue of undefined symbol
  • Loading branch information
AkihiroSuda committed Sep 30, 2020
2 parents ad1414d + d6ba496 commit 7c5957f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 16 deletions.
16 changes: 0 additions & 16 deletions runc.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"time"

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

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

// Runc is the client to the runc cli
type Runc struct {
//If command is empty, DefaultCommand is used
Command string
Root string
Debug bool
Log string
LogFormat Format
PdeathSignal unix.Signal
Setpgid bool
Criu string
SystemdCgroup bool
Rootless *bool // nil stands for "auto"
}

// List returns all containers created inside the provided runc root directory
func (r *Runc) List(context context.Context) ([]*Container, error) {
data, err := cmdOutput(r.command(context, "list", "--format=json"), false)
Expand Down
38 changes: 38 additions & 0 deletions runc_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//+build !windows

/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package runc

import (
"golang.org/x/sys/unix"
)

// Runc is the client to the runc cli
type Runc struct {
//If command is empty, DefaultCommand is used
Command string
Root string
Debug bool
Log string
LogFormat Format
PdeathSignal unix.Signal
Setpgid bool
Criu string
SystemdCgroup bool
Rootless *bool // nil stands for "auto"
}
31 changes: 31 additions & 0 deletions runc_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package runc

// Runc is the client to the runc cli
type Runc struct {
//If command is empty, DefaultCommand is used
Command string
Root string
Debug bool
Log string
LogFormat Format
Setpgid bool
Criu string
SystemdCgroup bool
Rootless *bool // nil stands for "auto"
}

0 comments on commit 7c5957f

Please sign in to comment.