Skip to content

Commit

Permalink
Merge pull request #66 from rgooch/master
Browse files Browse the repository at this point in the history
imagetool: fix panic in patch-directory subcommand when image not found.
  • Loading branch information
rgooch committed Apr 12, 2020
2 parents 835d167 + 3cd26e6 commit d8f7d12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/imagetool/diffImages.go
Expand Up @@ -103,7 +103,9 @@ func getImage(client *srpc.Client, name string) (*image.Image, error) {
if img == nil {
return nil, errors.New(name + ": not found")
}
img.FileSystem.RebuildInodePointers()
if err := img.FileSystem.RebuildInodePointers(); err != nil {
return nil, err
}
return img, nil
}

Expand Down
3 changes: 1 addition & 2 deletions cmd/imagetool/patchDirectory.go
Expand Up @@ -12,7 +12,6 @@ import (
"time"

domlib "github.com/Cloud-Foundations/Dominator/dom/lib"
imgclient "github.com/Cloud-Foundations/Dominator/imageserver/client"
"github.com/Cloud-Foundations/Dominator/lib/filesystem/scanner"
"github.com/Cloud-Foundations/Dominator/lib/format"
"github.com/Cloud-Foundations/Dominator/lib/fsutil"
Expand All @@ -37,7 +36,7 @@ func patchDirectorySubcommand(args []string, logger log.DebugLogger) error {
func patchDirectory(imageName, dirName string, logger log.DebugLogger) error {
imageSClient, objectClient := getClients()
logger.Debugf(0, "getting image: %s\n", imageName)
img, err := imgclient.GetImage(imageSClient, imageName)
img, err := getImage(imageSClient, imageName)
if err != nil {
return err
}
Expand Down

0 comments on commit d8f7d12

Please sign in to comment.