Skip to content

Commit 79f7676

Browse files
allow skipping errors while creating snowball archive
1 parent c0ea248 commit 79f7676

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/vulncheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
go-version: [ 1.20.6 ]
17+
go-version: [ 1.20.7 ]
1818
steps:
1919
- name: Check out code into the Go module directory
2020
uses: actions/checkout@v3

api-putobject-snowball.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ type SnowballOptions struct {
4848
// Compression will typically reduce memory and network usage,
4949
// Compression can safely be enabled with MinIO hosts.
5050
Compress bool
51+
52+
// SkipErrs if enabled will skip any errors while reading the
53+
// object content while creating the snowball archive
54+
SkipErrs bool
5155
}
5256

5357
// SnowballObject contains information about a single object to be added to the snowball.
@@ -184,10 +188,16 @@ objectLoop:
184188
n, err := io.Copy(t, obj.Content)
185189
if err != nil {
186190
closeObj()
191+
if opts.SkipErrs {
192+
continue
193+
}
187194
return err
188195
}
189196
if n != obj.Size {
190197
closeObj()
198+
if opts.SkipErrs {
199+
continue
200+
}
191201
return io.ErrUnexpectedEOF
192202
}
193203
closeObj()

0 commit comments

Comments
 (0)