Skip to content

Commit d88b1c3

Browse files
committed
Code review suggestions
1 parent a2d43d5 commit d88b1c3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pkg/reconciler/reconciler.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ func WithUninstallAnnotations(as ...annotation.Uninstall) Option {
445445
type PauseReconcileHandlerFunc func(ctx context.Context, obj *unstructured.Unstructured) (bool, error)
446446

447447
// WithPauseReconcileHandler is an Option that sets a PauseReconcile handler, which is a function that
448-
// that determines whether reconciliation should be paused for the custom resource watched by this reconciler.
448+
// determines whether reconciliation should be paused for the custom resource watched by this reconciler.
449449
//
450450
// Example usage: WithPauseReconcileHandler(PauseReconcileIfAnnotationTrue("my.domain/pause-reconcile"))
451451
func WithPauseReconcileHandler(handler PauseReconcileHandlerFunc) Option {
@@ -459,10 +459,8 @@ func WithPauseReconcileHandler(handler PauseReconcileHandlerFunc) Option {
459459
// annotation is present and set to "true"
460460
func PauseReconcileIfAnnotationTrue(annotationName string) PauseReconcileHandlerFunc {
461461
return func(ctx context.Context, obj *unstructured.Unstructured) (bool, error) {
462-
if v, ok := obj.GetAnnotations()[annotationName]; ok {
463-
if v == "true" {
464-
return true, nil
465-
}
462+
if v, ok := obj.GetAnnotations()[annotationName]; ok && v == "true" {
463+
return true, nil
466464
}
467465

468466
return false, nil

0 commit comments

Comments
 (0)