فهرست منبع

Merge pull request #40135 from thaJeztah/nitfix_galore

pkg/system: make OSVersion an alias for hcsshim OSVersion
Brian Goff 5 سال پیش
والد
کامیت
8840071c26
2فایلهای تغییر یافته به همراه2 افزوده شده و 8 حذف شده
  1. 0 1
      integration-cli/docker_cli_start_test.go
  2. 2 7
      pkg/system/syscall_windows.go

+ 0 - 1
integration-cli/docker_cli_start_test.go

@@ -9,7 +9,6 @@ import (
 	"time"
 
 	"github.com/Microsoft/hcsshim/osversion"
-
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/pkg/parsers/kernel"
 	"gotest.tools/assert"

+ 2 - 7
pkg/system/syscall_windows.go

@@ -1,7 +1,6 @@
 package system // import "github.com/docker/docker/pkg/system"
 
 import (
-	"fmt"
 	"syscall"
 	"unsafe"
 
@@ -62,7 +61,7 @@ var (
 
 // OSVersion is a wrapper for Windows version information
 // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx
-type OSVersion osversion.OSVersion
+type OSVersion = osversion.OSVersion
 
 // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724833(v=vs.85).aspx
 type osVersionInfoEx struct {
@@ -83,11 +82,7 @@ type osVersionInfoEx struct {
 // dockerd.exe must be manifested to get the correct version information.
 // Deprecated: use github.com/Microsoft/hcsshim/osversion.Get() instead
 func GetOSVersion() OSVersion {
-	return OSVersion(osversion.Get())
-}
-
-func (osv OSVersion) ToString() string {
-	return fmt.Sprintf("%d.%d.%d", osv.MajorVersion, osv.MinorVersion, osv.Build)
+	return osversion.Get()
 }
 
 // IsWindowsClient returns true if the SKU is client