Skip to content

Commit

Permalink
verity: also check corruption in existing mounts
Browse files Browse the repository at this point in the history
If we are mounting a mol where one of the atoms already been mounted,
then we should check the already-mounted devices for any corruption
reported by devicemapper as well, and at least fail to mount the new
image using them.

Signed-off-by: Michael McCracken <[email protected]>
  • Loading branch information
mikemccracken committed Sep 26, 2024
1 parent 0716bf1 commit 4837f40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions molecule.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func (m Molecule) mountUnderlyingAtoms() error {
if err != nil {
return err
}
err = squashfs.ConfirmExistingVerityDeviceCurrentValidity(mountpoint.Source)
if err != nil {
return err

Check warning on line 66 in molecule.go

View check run for this annotation

Codecov / codecov/patch

molecule.go#L64-L66

Added lines #L64 - L66 were not covered by tests
}
}
continue
}
Expand Down

0 comments on commit 4837f40

Please sign in to comment.