Skip to content

Commit 340ab57

Browse files
Merge pull request #4707 from kzys/lcow-arm
Do not hardcode "amd64" on LCOW and Windows-related files
2 parents 0edc412 + bb8aac3 commit 340ab57

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

diff/lcow/lcow.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"io/ioutil"
2525
"os"
2626
"path"
27+
"runtime"
2728
"time"
2829

2930
"github.com/Microsoft/go-winio/pkg/security"
@@ -61,7 +62,7 @@ func init() {
6162

6263
ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{
6364
OS: "linux",
64-
Architecture: "amd64",
65+
Architecture: runtime.GOARCH,
6566
})
6667
return NewWindowsLcowDiff(md.(*metadata.DB).ContentStore())
6768
},

platforms/defaults_windows.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
package platforms
2020

2121
import (
22+
"runtime"
23+
2224
specs "github.com/opencontainers/image-spec/specs-go/v1"
2325
)
2426

2527
// Default returns the default matcher for the platform.
2628
func Default() MatchComparer {
2729
return Ordered(DefaultSpec(), specs.Platform{
2830
OS: "linux",
29-
Architecture: "amd64",
31+
Architecture: runtime.GOARCH,
3032
})
3133
}

snapshots/lcow/lcow.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"io"
2626
"os"
2727
"path/filepath"
28+
"runtime"
2829
"strconv"
2930
"strings"
3031
"sync"
@@ -50,7 +51,7 @@ func init() {
5051
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
5152
ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{
5253
OS: "linux",
53-
Architecture: "amd64",
54+
Architecture: runtime.GOARCH,
5455
})
5556
return NewSnapshotter(ic.Root)
5657
},

0 commit comments

Comments
 (0)