@@ -39,17 +39,17 @@ const (
3939
4040func defaultContainerdArchives () []File {
4141 const nerdctlVersion = "1.5.0"
42- location := func (goarch string ) string {
43- return "https://github.com/containerd/nerdctl/releases/download/v" + nerdctlVersion + "/nerdctl-full-" + nerdctlVersion + "-linux -" + goarch + ".tar.gz"
42+ location := func (goos string , goarch string ) string {
43+ return "https://github.com/containerd/nerdctl/releases/download/v" + nerdctlVersion + "/nerdctl-full-" + nerdctlVersion + "-" + goos + " -" + goarch + ".tar.gz"
4444 }
4545 return []File {
4646 {
47- Location : location ("amd64" ),
47+ Location : location ("linux" , " amd64" ),
4848 Arch : X8664 ,
4949 Digest : "sha256:3f8c494e3c6a265fe2a3c41ef9d6bc859eeeb22095b3353d3558d8120833a23a" ,
5050 },
5151 {
52- Location : location ("arm64" ),
52+ Location : location ("linux" , " arm64" ),
5353 Arch : AARCH64 ,
5454 Digest : "sha256:32a2537e0a80e1493b5934ca56c3e237466606a1b720aef23b9c0a7fc3303bdb" ,
5555 },
@@ -134,6 +134,13 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
134134 y .VMType = o .VMType
135135 }
136136 y .VMType = pointer .String (ResolveVMType (y .VMType ))
137+ if y .OS == nil {
138+ y .OS = d .OS
139+ }
140+ if o .OS != nil {
141+ y .OS = o .OS
142+ }
143+ y .OS = pointer .String (ResolveOS (y .OS ))
137144 if y .Arch == nil {
138145 y .Arch = d .Arch
139146 }
@@ -768,6 +775,16 @@ func FillCopyToHostDefaults(rule *CopyToHost, instDir string) {
768775 }
769776}
770777
778+ func NewOS (osname string ) OS {
779+ switch osname {
780+ case "linux" :
781+ return LINUX
782+ default :
783+ logrus .Warnf ("Unknown os: %s" , osname )
784+ return osname
785+ }
786+ }
787+
771788func goarm () int {
772789 if runtime .GOOS != "linux" {
773790 return 0
@@ -824,6 +841,13 @@ func ResolveVMType(s *string) VMType {
824841 return NewVMType (* s )
825842}
826843
844+ func ResolveOS (s * string ) OS {
845+ if s == nil || * s == "" || * s == "default" {
846+ return NewOS ("linux" )
847+ }
848+ return * s
849+ }
850+
827851func ResolveArch (s * string ) Arch {
828852 if s == nil || * s == "" || * s == "default" {
829853 return NewArch (runtime .GOARCH )
0 commit comments