From 05fcc4aef3b1da8c0f1de05878aabd8c3f6700ae Mon Sep 17 00:00:00 2001 From: Kumar Gaurav Sharma Date: Wed, 14 Jul 2021 14:28:06 -0700 Subject: [PATCH] fix for #866 - nil interface check during delete --- pkg/runtime/reconciler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/runtime/reconciler.go b/pkg/runtime/reconciler.go index 5693c31..3f5477e 100644 --- a/pkg/runtime/reconciler.go +++ b/pkg/runtime/reconciler.go @@ -16,7 +16,7 @@ package runtime import ( "context" "time" - + "github.com/go-logr/logr" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" @@ -34,6 +34,7 @@ import ( ackrtcache "github.com/aws-controllers-k8s/runtime/pkg/runtime/cache" ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log" acktypes "github.com/aws-controllers-k8s/runtime/pkg/types" + ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare" ) // reconciler describes a generic reconciler within ACK. @@ -361,7 +362,7 @@ func (r *resourceReconciler) cleanup( rlog.Enter("rm.Delete") latest, err := rm.Delete(ctx, observed) rlog.Exit("rm.Delete", err) - if latest != nil { + if ackcompare.IsNotNil(latest) { // The Delete operation is likely asynchronous and has likely set a Status // field on the returned CR to something like `deleting`. Here, we patchResource() // in order to save these Status field modifications.