Skip to content

Unwrap error when checking for not found. #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/patterns/declarative/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (r *Reconciler) reconcileExists(ctx context.Context, name types.NamespacedN
for _, obj := range objects.Items {

unstruct, err := GetObjectFromCluster(obj, r)
if err != nil && !apierrors.IsNotFound(err) {
if err != nil && !apierrors.IsNotFound(errors.Unwrap(err)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note (not scoped for this PR) that we should probably move to using new helpers available in the errors package. such as errors.Is(...)

log.WithValues("name", obj.Name).Error(err, "Unable to get resource")
}
if unstruct != nil {
Expand Down