Skip to content

Commit

Permalink
core: Handle pkg apply command when root image doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
matbme committed Jun 7, 2023
1 parent 6115ac0 commit a38e3d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func FindImageWithLabel(key, value string) (string, error) {
return "", nil
}

// DeleteImageForRoot retrieves the image created for the provided root ("vos-a"|"vos-b")
// RetrieveImageForRoot retrieves the image created for the provided root ("vos-a"|"vos-b")
func RetrieveImageForRoot(root string) (string, error) {
PrintVerbose("ApplyInImageForRoot: running...")

Expand Down
4 changes: 4 additions & 0 deletions core/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ func (s *ABSystem) RunOperation(operation ABSystemOperation) error {
PrintVerbose("ABSystemRunOperation:err(3.3): %s", err)
return err
}
// Handle case where an image for the current root may not exist in storage
if imageName == "" {
imageName = settings.Cnf.FullImageName
}
} else {
imageName = strings.Split(settings.Cnf.FullImageName, ":")[0] + "@" + imageDigest
labels["ABRoot.BaseImageDigest"] = s.CurImage.Digest
Expand Down

0 comments on commit a38e3d2

Please sign in to comment.