Skip to content

Commit

Permalink
Log Generation / Observed generation.
Browse files Browse the repository at this point in the history
While waiting for GatewayClass to be ready, log the Generation /
ObservedGeneration since it gives a useful signal on whether the
controller is stuck, or trying to converge forever.
  • Loading branch information
briantkennedy committed Feb 27, 2023
1 parent 24b762c commit 0d4c325
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions conformance/utils/kubernetes/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,14 @@ func ConditionsHaveLatestObservedGeneration(obj metav1.Object, conditions []meta
return nil
}

wantGeneration := obj.GetGeneration()
var b strings.Builder
fmt.Fprint(&b, "expected observedGeneration to be updated for all conditions")
fmt.Fprintf(&b, "expected observedGeneration to be updated to %d for all conditions", wantGeneration)
fmt.Fprintf(&b, ", only %d/%d were updated.", len(conditions)-len(staleConditions), len(conditions))
fmt.Fprintf(&b, " stale conditions are: ")

for i, c := range staleConditions {
fmt.Fprintf(&b, c.Type)
fmt.Fprintf(&b, "%s (got %d)", c.Type, c.ObservedGeneration)
if i != len(staleConditions)-1 {
fmt.Fprintf(&b, ", ")
}
Expand Down

0 comments on commit 0d4c325

Please sign in to comment.