Add os_version and os_features to Image

These fields are needed to specify the exact version of Windows that an
image can run on. They may be useful for other platforms in the future.

This also changes image.store.Create to validate that the loaded image is
supported on the current machine. This change affects Linux as well, since
it now validates the architecture and OS fields.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 194eaa5c0f843257e66b68bd735786308a9d93b2
Component: engine
This commit is contained in:
John Starks
2016-03-16 18:45:40 -07:00
parent c4d2d001a2
commit 4815437b5f
15 changed files with 248 additions and 32 deletions

View File

@ -59,10 +59,7 @@ func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) {
// console which supports ANSI emulation, or fall-back to the golang emulator
// (github.com/azure/go-ansiterm).
func useNativeConsole() bool {
osv, err := system.GetOSVersion()
if err != nil {
return false
}
osv := system.GetOSVersion()
// Native console is not available before major version 10
if osv.MajorVersion < 10 {