Do not hardcode "amd64" on LCOW and Windows-related files
Fixes #3281. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
		| @@ -24,6 +24,7 @@ import ( | |||||||
| 	"io/ioutil" | 	"io/ioutil" | ||||||
| 	"os" | 	"os" | ||||||
| 	"path" | 	"path" | ||||||
|  | 	"runtime" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| 	"github.com/Microsoft/go-winio/pkg/security" | 	"github.com/Microsoft/go-winio/pkg/security" | ||||||
| @@ -61,7 +62,7 @@ func init() { | |||||||
|  |  | ||||||
| 			ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{ | 			ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{ | ||||||
| 				OS:           "linux", | 				OS:           "linux", | ||||||
| 				Architecture: "amd64", | 				Architecture: runtime.GOARCH, | ||||||
| 			}) | 			}) | ||||||
| 			return NewWindowsLcowDiff(md.(*metadata.DB).ContentStore()) | 			return NewWindowsLcowDiff(md.(*metadata.DB).ContentStore()) | ||||||
| 		}, | 		}, | ||||||
|   | |||||||
| @@ -19,6 +19,8 @@ | |||||||
| package platforms | package platforms | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
|  | 	"runtime" | ||||||
|  |  | ||||||
| 	specs "github.com/opencontainers/image-spec/specs-go/v1" | 	specs "github.com/opencontainers/image-spec/specs-go/v1" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| @@ -26,6 +28,6 @@ import ( | |||||||
| func Default() MatchComparer { | func Default() MatchComparer { | ||||||
| 	return Ordered(DefaultSpec(), specs.Platform{ | 	return Ordered(DefaultSpec(), specs.Platform{ | ||||||
| 		OS:           "linux", | 		OS:           "linux", | ||||||
| 		Architecture: "amd64", | 		Architecture: runtime.GOARCH, | ||||||
| 	}) | 	}) | ||||||
| } | } | ||||||
|   | |||||||
| @@ -25,6 +25,7 @@ import ( | |||||||
| 	"io" | 	"io" | ||||||
| 	"os" | 	"os" | ||||||
| 	"path/filepath" | 	"path/filepath" | ||||||
|  | 	"runtime" | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"sync" | 	"sync" | ||||||
| @@ -50,7 +51,7 @@ func init() { | |||||||
| 		InitFn: func(ic *plugin.InitContext) (interface{}, error) { | 		InitFn: func(ic *plugin.InitContext) (interface{}, error) { | ||||||
| 			ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{ | 			ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{ | ||||||
| 				OS:           "linux", | 				OS:           "linux", | ||||||
| 				Architecture: "amd64", | 				Architecture: runtime.GOARCH, | ||||||
| 			}) | 			}) | ||||||
| 			return NewSnapshotter(ic.Root) | 			return NewSnapshotter(ic.Root) | ||||||
| 		}, | 		}, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kazuyoshi Kato
					Kazuyoshi Kato