Update hcsshim to v0.12.0-rc.3

Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
This commit is contained in:
Kirtana Ashok
2024-02-05 10:42:36 -08:00
parent f5e7fe0cb6
commit 64e96c7d47
12 changed files with 119 additions and 469 deletions

View File

@@ -18,11 +18,12 @@ import (
)
type params struct {
convertWhiteout bool
convertBackslash bool
appendVhdFooter bool
appendDMVerity bool
ext4opts []compactext4.Option
convertWhiteout bool
convertBackslash bool
appendVhdFooter bool
onlyAppendVhdFooter bool
appendDMVerity bool
ext4opts []compactext4.Option
}
// Option is the type for optional parameters to Convert.
@@ -46,6 +47,12 @@ func AppendVhdFooter(p *params) {
p.appendVhdFooter = true
}
// OnlyAppendVhdFooter instructs the converter not to convert but still to add a fixed VHD footer to the
// file.
func OnlyAppendVhdFooter(p *params) {
p.onlyAppendVhdFooter = true
}
// AppendDMVerity instructs the converter to add a dmverity Merkle tree for
// the ext4 filesystem after the filesystem and before the optional VHD footer
func AppendDMVerity(p *params) {
@@ -201,6 +208,14 @@ func Convert(r io.Reader, w io.ReadWriteSeeker, options ...Option) error {
opt(&p)
}
if p.onlyAppendVhdFooter {
_, err := io.Copy(w, r)
if err != nil {
return err
}
return ConvertToVhd(w)
}
if err := ConvertTarToExt4(r, w, options...); err != nil {
return err
}