diff --git a/libcontainer/specconv/example.go b/libcontainer/specconv/example.go index 33134116c..d6621194c 100644 --- a/libcontainer/specconv/example.go +++ b/libcontainer/specconv/example.go @@ -2,7 +2,6 @@ package specconv import ( "os" - "runtime" "strings" "github.com/opencontainers/runtime-spec/specs-go" @@ -15,10 +14,6 @@ func sPtr(s string) *string { return &s } func Example() *specs.Spec { return &specs.Spec{ Version: specs.Version, - Platform: specs.Platform{ - OS: runtime.GOOS, - Arch: runtime.GOARCH, - }, Root: specs.Root{ Path: "rootfs", Readonly: true, diff --git a/spec.go b/spec.go index 92d38f578..876937d26 100644 --- a/spec.go +++ b/spec.go @@ -7,7 +7,6 @@ import ( "fmt" "io/ioutil" "os" - "runtime" "github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/specconv" @@ -131,9 +130,6 @@ func loadSpec(cPath string) (spec *specs.Spec, err error) { if err = json.NewDecoder(cf).Decode(&spec); err != nil { return nil, err } - if err = validatePlatform(&spec.Platform); err != nil { - return nil, err - } return spec, validateProcessSpec(spec.Process) } @@ -148,13 +144,3 @@ func createLibContainerRlimit(rlimit specs.LinuxRlimit) (configs.Rlimit, error) Soft: rlimit.Soft, }, nil } - -func validatePlatform(platform *specs.Platform) error { - if platform.OS != runtime.GOOS { - return fmt.Errorf("target os %s mismatch with current os %s", platform.OS, runtime.GOOS) - } - if platform.Arch != runtime.GOARCH { - return fmt.Errorf("target arch %s mismatch with current arch %s", platform.Arch, runtime.GOARCH) - } - return nil -}