Skip to content

Commit 43f0888

Browse files
authored
Fix copacetic error handling when no vulnerabilities found
1 parent fe0978a commit 43f0888

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/copa/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (o PatchOption) Run(ctx context.Context, reportFilePaths map[*registry.Imag
7070
CertPath: o.Buildkit.CertPath,
7171
KeyPath: o.Buildkit.KeyPath,
7272
}, outFilePaths[i]); err != nil {
73-
return fmt.Errorf("error patching image %s :: %w ", ref, err)
73+
return fmt.Errorf("error patching image %s :: %w", ref, err)
7474
}
7575

7676
_ = bar.Add(1)

pkg/copa/patch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func Patch(ctx context.Context, timeout time.Duration, image, reportFile, patche
5858

5959
select {
6060
case err := <-ch:
61-
if err == nil {
61+
if err == nil || err.String() == "no patchable vulnerabilities found" {
6262
return nil
6363
}
6464
return fmt.Errorf("copa: error patching image :: %w", err)

0 commit comments

Comments
 (0)