Skip to content

Commit d572614

Browse files
committed
Unify ErrAlreadyExists to correctly match
1 parent 8642d88 commit d572614

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

pkg/cli/image/mirror/mappings.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ import (
1414
"github.com/openshift/oc/pkg/cli/image/imagesource"
1515
)
1616

17-
// ErrAlreadyExists may be returned by the blob Create function to indicate that the blob already exists.
18-
var ErrAlreadyExists = fmt.Errorf("blob already exists in the target location")
19-
2017
type Mapping struct {
2118
Source imagesource.TypedImageReference
2219
Destination imagesource.TypedImageReference

pkg/cli/image/mirror/mirror.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ func copyBlob(ctx context.Context, plan *workPlan, c *repositoryBlobCopy, blob d
723723
copyfn := func() error {
724724
w, err := c.to.Create(ctx, options...)
725725
// no-op
726-
if err == ErrAlreadyExists {
726+
if errors.Is(err, imagesource.ErrAlreadyExists) {
727727
klog.V(5).Infof("Blob already exists %#v", blob)
728728
return nil
729729
}

0 commit comments

Comments
 (0)