Skip to content

Commit

Permalink
fix unsafe GetReadyCR check
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinsonneau committed Nov 16, 2022
1 parent b731ad6 commit 02ddfe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/flowcollector_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ func GetReadyCR(key types.NamespacedName) *flowsv1alpha1.FlowCollector {
return err
}
cond := meta.FindStatusCondition(cr.Status.Conditions, conditions.TypeReady)
if cond.Status == metav1.ConditionFalse {
if cond != nil && cond.Status == metav1.ConditionFalse {
return fmt.Errorf("CR is not ready: %s - %v", cond.Reason, cond.Message)
}
return nil
Expand Down

0 comments on commit 02ddfe0

Please sign in to comment.