mirror of https://github.com/knative/pkg.git
add nil check to postprocess (#1343)
* add nil check * separate the two warnings * inline top-level condition
This commit is contained in:
parent
3afddc40ce
commit
e9aa6aa686
|
|
@ -48,8 +48,9 @@ func PostProcessReconcile(ctx context.Context, resource duckv1.KRShaped) {
|
|||
// generation regardless of success or failure.
|
||||
newStatus.ObservedGeneration = resource.GetGeneration()
|
||||
|
||||
rc := mgr.GetTopLevelCondition()
|
||||
if rc.Reason == failedGenerationBump {
|
||||
if rc := mgr.GetTopLevelCondition(); rc == nil {
|
||||
logger.Warn("A reconciliation included no top-level condition")
|
||||
} else if rc.Reason == failedGenerationBump {
|
||||
logger.Warn("A reconciler observed a new generation without updating the resource status")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue