Browse code

LCOW: Check OS in takeLayerReference

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2018/03/14 01:46:21
Showing 1 changed files
... ...
@@ -158,6 +158,9 @@ func (l *tarexporter) takeLayerReference(id image.ID, imgDescr *imageDescriptor)
158 158
 	if os == "" {
159 159
 		os = runtime.GOOS
160 160
 	}
161
+	if !system.IsOSSupported(os) {
162
+		return fmt.Errorf("os %q is not supported", os)
163
+	}
161 164
 	layer, err := l.lss[os].Get(topLayerID)
162 165
 	if err != nil {
163 166
 		return err