Skip to content

Commit 4d298b5

Browse files
committed
fix local path file name
it fixes how the local path is generated in the noop image puller. Before the name ended up having 2 dots <name>..raw Signed-off-by: Luca Stocchi <[email protected]>
1 parent 2d53cdf commit 4d298b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/imagepullers/noop.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (puller *NoopImagePuller) SetSourceURI(sourcePath string) {
3333

3434
func imageExtension(sourceURI string) string {
3535
if strings.HasSuffix(sourceURI, ".tar.gz") {
36-
return "tar.gz"
36+
return ".tar.gz"
3737
}
3838
return filepath.Ext(sourceURI)
3939
}
@@ -50,7 +50,7 @@ func (puller *NoopImagePuller) LocalPath() (*define.VMFile, error) {
5050
return nil, err
5151
}
5252

53-
vmFile, err := dirs.DataDir.AppendToNewVMFile(fmt.Sprintf("%s-%s.%s", puller.machineName, puller.vmType.String(), imageExtension(puller.sourceURI)), nil)
53+
vmFile, err := dirs.DataDir.AppendToNewVMFile(fmt.Sprintf("%s-%s%s", puller.machineName, puller.vmType.String(), imageExtension(puller.sourceURI)), nil)
5454
if err != nil {
5555
return nil, err
5656
}

0 commit comments

Comments
 (0)