summaryrefslogtreecommitdiff
path: root/plugin/backend_linux.go
diff options
context:
space:
mode:
authorJohn Howard <jhoward@microsoft.com>2018-02-15 13:17:27 -0800
committerJohn Howard <jhoward@microsoft.com>2018-02-26 12:33:54 -0800
commit83908836d35b9f85a94489854d7eefd7dce785f8 (patch)
tree981ada50d27d21aa8bdf99d38e28841311f83994 /plugin/backend_linux.go
parent68c3201626439d5be5c24d14d4fe7e27fe93954d (diff)
downloaddocker-83908836d35b9f85a94489854d7eefd7dce785f8.tar.gz
Windows: Block pulling uplevel images
Signed-off-by: John Howard <jhoward@microsoft.com>
Diffstat (limited to 'plugin/backend_linux.go')
-rw-r--r--plugin/backend_linux.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugin/backend_linux.go b/plugin/backend_linux.go
index c86b11f61a..000ee996dc 100644
--- a/plugin/backend_linux.go
+++ b/plugin/backend_linux.go
@@ -33,6 +33,7 @@ import (
"github.com/docker/docker/plugin/v2"
refstore "github.com/docker/docker/reference"
digest "github.com/opencontainers/go-digest"
+ specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
@@ -146,10 +147,15 @@ func (s *tempConfigStore) Get(d digest.Digest) ([]byte, error) {
return s.config, nil
}
-func (s *tempConfigStore) RootFSAndOSFromConfig(c []byte) (*image.RootFS, string, error) {
+func (s *tempConfigStore) RootFSFromConfig(c []byte) (*image.RootFS, error) {
return configToRootFS(c)
}
+func (s *tempConfigStore) PlatformFromConfig(c []byte) (*specs.Platform, error) {
+ // TODO: LCOW/Plugins. This will need revisiting. For now use the runtime OS
+ return &specs.Platform{OS: runtime.GOOS}, nil
+}
+
func computePrivileges(c types.PluginConfig) types.PluginPrivileges {
var privileges types.PluginPrivileges
if c.Network.Type != "null" && c.Network.Type != "bridge" && c.Network.Type != "" {
@@ -534,10 +540,15 @@ func (s *pluginConfigStore) Get(d digest.Digest) ([]byte, error) {
return ioutil.ReadAll(rwc)
}
-func (s *pluginConfigStore) RootFSAndOSFromConfig(c []byte) (*image.RootFS, string, error) {
+func (s *pluginConfigStore) RootFSFromConfig(c []byte) (*image.RootFS, error) {
return configToRootFS(c)
}
+func (s *pluginConfigStore) PlatformFromConfig(c []byte) (*specs.Platform, error) {
+ // TODO: LCOW/Plugins. This will need revisiting. For now use the runtime OS
+ return &specs.Platform{OS: runtime.GOOS}, nil
+}
+
type pluginLayerProvider struct {
pm *Manager
plugin *v2.Plugin