Skip to content

Commit

Permalink
fix local path file name
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
lstocchi committed Feb 27, 2025
1 parent 2d53cdf commit 4d298b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/imagepullers/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (puller *NoopImagePuller) SetSourceURI(sourcePath string) {

func imageExtension(sourceURI string) string {
if strings.HasSuffix(sourceURI, ".tar.gz") {
return "tar.gz"
return ".tar.gz"
}
return filepath.Ext(sourceURI)
}
Expand All @@ -50,7 +50,7 @@ func (puller *NoopImagePuller) LocalPath() (*define.VMFile, error) {
return nil, err
}

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

0 comments on commit 4d298b5

Please sign in to comment.