Skip to content

Commit d91ddd7

Browse files
authored
Merge pull request #3190 from s1gnate-sync/master
Update go-diskfs package to 1.5.0
2 parents 9f1390b + 2a06a81 commit d91ddd7

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/cpuguy83/go-md2man/v2 v2.0.6
1818
github.com/cyphar/filepath-securejoin v0.4.1
1919
github.com/digitalocean/go-qemu v0.0.0-20221209210016-f035778c97f7
20-
github.com/diskfs/go-diskfs v1.4.1
20+
github.com/diskfs/go-diskfs v1.5.0
2121
github.com/docker/go-units v0.5.0
2222
github.com/elastic/go-libaudit/v2 v2.6.1
2323
github.com/foxcpp/go-mockdns v1.1.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ github.com/digitalocean/go-qemu v0.0.0-20221209210016-f035778c97f7 h1:3OVJAbR131
6464
github.com/digitalocean/go-qemu v0.0.0-20221209210016-f035778c97f7/go.mod h1:K4+o74YGNjOb9N6yyG+LPj1NjHtk+Qz0IYQPvirbaLs=
6565
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
6666
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
67-
github.com/diskfs/go-diskfs v1.4.1 h1:iODgkzHLmvXS+1VDztpW53T+dQm8GQzi20y9yUd5UCA=
68-
github.com/diskfs/go-diskfs v1.4.1/go.mod h1:+tOkQs8CMMog6Nvljg8DGIxEXrgL48iyT3OM3IlSz74=
67+
github.com/diskfs/go-diskfs v1.5.0 h1:0SANkrab4ifiZBytk380gIesYh5Gc+3i40l7qsrYP4s=
68+
github.com/diskfs/go-diskfs v1.5.0/go.mod h1:bRFumZeGFCO8C2KNswrQeuj2m1WCVr4Ms5IjWMczMDk=
6969
github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c=
7070
github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0=
7171
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=

pkg/iso9660util/iso9660util.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"path/filepath"
88
"runtime"
99

10+
"github.com/diskfs/go-diskfs/backend/file"
1011
"github.com/diskfs/go-diskfs/filesystem"
1112
"github.com/diskfs/go-diskfs/filesystem/iso9660"
1213
"github.com/sirupsen/logrus"
@@ -27,6 +28,7 @@ func Write(isoPath, label string, layout []Entry) error {
2728
return err
2829
}
2930

31+
backendFile := file.New(isoFile, false)
3032
defer isoFile.Close()
3133

3234
workdir, err := os.MkdirTemp("", "diskfs_iso")
@@ -39,7 +41,7 @@ func Write(isoPath, label string, layout []Entry) error {
3941
}
4042
logrus.Debugf("Creating iso file %s", isoFile.Name())
4143
logrus.Debugf("Using %s as workspace", workdir)
42-
fs, err := iso9660.Create(isoFile, 0, 0, 0, workdir)
44+
fs, err := iso9660.Create(backendFile, 0, 0, 0, workdir)
4345
if err != nil {
4446
return err
4547
}
@@ -81,11 +83,12 @@ func IsISO9660(imagePath string) (bool, error) {
8183
return false, err
8284
}
8385
defer imageFile.Close()
86+
backendFile := file.New(imageFile, true)
8487

8588
fileInfo, err := imageFile.Stat()
8689
if err != nil {
8790
return false, err
8891
}
89-
_, err = iso9660.Read(imageFile, fileInfo.Size(), 0, 0)
92+
_, err = iso9660.Read(backendFile, fileInfo.Size(), 0, 0)
9093
return err == nil, nil
9194
}

0 commit comments

Comments
 (0)