Skip to content

Commit 5f0499c

Browse files
fix for #866 - nil Interface check during delete (#30)
Issue: aws-controllers-k8s/community#866 Fix: `nil` Interface check during delete By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 308bc45 commit 5f0499c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/runtime/reconciler.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package runtime
1616
import (
1717
"context"
1818
"time"
19-
19+
2020
"github.com/go-logr/logr"
2121
"github.com/pkg/errors"
2222
corev1 "k8s.io/api/core/v1"
@@ -34,6 +34,7 @@ import (
3434
ackrtcache "github.com/aws-controllers-k8s/runtime/pkg/runtime/cache"
3535
ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log"
3636
acktypes "github.com/aws-controllers-k8s/runtime/pkg/types"
37+
ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
3738
)
3839

3940
// reconciler describes a generic reconciler within ACK.
@@ -361,7 +362,7 @@ func (r *resourceReconciler) cleanup(
361362
rlog.Enter("rm.Delete")
362363
latest, err := rm.Delete(ctx, observed)
363364
rlog.Exit("rm.Delete", err)
364-
if latest != nil {
365+
if ackcompare.IsNotNil(latest) {
365366
// The Delete operation is likely asynchronous and has likely set a Status
366367
// field on the returned CR to something like `deleting`. Here, we patchResource()
367368
// in order to save these Status field modifications.

0 commit comments

Comments
 (0)