Skip to content

Commit b5408d2

Browse files
lstocchicfergeau
authored andcommitted
use extension of source image on WSL
on WSL, when copying the source image to its local macadam folder (.local\share\containers\macadam\machine\wsl) macadam was assuming that the image had .tar.gz format. However, there is a new WSL distribution format that we have to support .wsl. This patch adds a check to reuse .wsl extension if sourceUri uses it. Signed-off-by: lstocchi <lstocchi@redhat.com>
1 parent 7643d48 commit b5408d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/imagepullers/noop.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func (puller *NoopImagePuller) SetSourceURI(sourcePath string) {
3939
func imageExtension(vmType define.VMType, sourceURI string) string {
4040
switch vmType {
4141
case define.WSLVirt:
42+
ext := filepath.Ext(sourceURI)
43+
if ext == ".wsl" {
44+
return ".wsl"
45+
}
4246
return ".tar.gz"
4347
case define.QemuVirt, define.HyperVVirt:
4448
return filepath.Ext(sourceURI)

0 commit comments

Comments
 (0)