mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Remove Platform as no longer in OCI spec
This was never used, just validated, so was removed from spec. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
@@ -2,7 +2,6 @@ package specconv
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
@@ -15,10 +14,6 @@ func sPtr(s string) *string { return &s }
|
|||||||
func Example() *specs.Spec {
|
func Example() *specs.Spec {
|
||||||
return &specs.Spec{
|
return &specs.Spec{
|
||||||
Version: specs.Version,
|
Version: specs.Version,
|
||||||
Platform: specs.Platform{
|
|
||||||
OS: runtime.GOOS,
|
|
||||||
Arch: runtime.GOARCH,
|
|
||||||
},
|
|
||||||
Root: specs.Root{
|
Root: specs.Root{
|
||||||
Path: "rootfs",
|
Path: "rootfs",
|
||||||
Readonly: true,
|
Readonly: true,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
|
||||||
|
|
||||||
"github.com/opencontainers/runc/libcontainer/configs"
|
"github.com/opencontainers/runc/libcontainer/configs"
|
||||||
"github.com/opencontainers/runc/libcontainer/specconv"
|
"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 {
|
if err = json.NewDecoder(cf).Decode(&spec); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if err = validatePlatform(&spec.Platform); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return spec, validateProcessSpec(spec.Process)
|
return spec, validateProcessSpec(spec.Process)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,13 +144,3 @@ func createLibContainerRlimit(rlimit specs.LinuxRlimit) (configs.Rlimit, error)
|
|||||||
Soft: rlimit.Soft,
|
Soft: rlimit.Soft,
|
||||||
}, nil
|
}, 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
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user