Skip to content

Commit 4040df9

Browse files
committed
Unwrap error when checking for not found.
This has been logging erronious not found errors since the returned error wraps the not found error.
1 parent 4ba4cad commit 4040df9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/patterns/declarative/reconciler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (r *Reconciler) reconcileExists(ctx context.Context, name types.NamespacedN
201201
for _, obj := range objects.Items {
202202

203203
unstruct, err := GetObjectFromCluster(obj, r)
204-
if err != nil && !apierrors.IsNotFound(err) {
204+
if err != nil && !apierrors.IsNotFound(errors.Unwrap(err)) {
205205
log.WithValues("name", obj.Name).Error(err, "Unable to get resource")
206206
}
207207
if unstruct != nil {

0 commit comments

Comments
 (0)