Skip to content

Commit fb99731

Browse files
committed
Adress early return in hooks.go customPreCompare
#129 (comment)
1 parent 3bb1d05 commit fb99731

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Diff for: pkg/resource/table/hooks.go

+8-9
Original file line numberDiff line numberDiff line change
@@ -614,15 +614,14 @@ func customPreCompare(
614614
// Making this field a no-op if user does not set it.
615615
// This will ensure controller does not act on this field
616616
// if user is unaware of it.
617-
if a.ko.Spec.ContributorInsights == nil {
618-
return
619-
}
620-
// latestInsight will always be either ENABLED or DISABLED, since we requeue at readOne if its not
621-
// either
622-
desiredInsight, _ := ensureContibutorInsight(a)
623-
latestInsight, _ := ensureContibutorInsight(b)
624-
if desiredInsight != latestInsight {
625-
delta.Add("Spec.ContributorInsights", a.ko.Spec.ContributorInsights, b.ko.Spec.ContributorInsights)
617+
if a.ko.Spec.ContributorInsights != nil {
618+
// latestInsight will always be either ENABLED or DISABLED, since we requeue at readOne if its not
619+
// either
620+
desiredInsight, _ := ensureContibutorInsight(a)
621+
latestInsight, _ := ensureContibutorInsight(b)
622+
if desiredInsight != latestInsight {
623+
delta.Add("Spec.ContributorInsights", a.ko.Spec.ContributorInsights, b.ko.Spec.ContributorInsights)
624+
}
626625
}
627626

628627
}

0 commit comments

Comments
 (0)