@@ -79,8 +79,9 @@ func updateGatewayClassAcceptedCondition(ctx context.Context, k8sClient client.C
7979 storedStatus := gwClass .Status .Conditions [indxToUpdate ].Status
8080 storedMessage := gwClass .Status .Conditions [indxToUpdate ].Message
8181 storedReason := gwClass .Status .Conditions [indxToUpdate ].Reason
82+ storedObservedGeneration := gwClass .Status .Conditions [indxToUpdate ].ObservedGeneration
8283
83- if storedStatus == newStatus && storedMessage == message && storedReason == reason {
84+ if storedStatus == newStatus && storedMessage == message && storedReason == reason && storedObservedGeneration == gwClass . Generation {
8485 return nil
8586 }
8687
@@ -99,7 +100,6 @@ func updateGatewayClassAcceptedCondition(ctx context.Context, k8sClient client.C
99100
100101// prepareGatewayConditionUpdate inserts the necessary data into the condition field of the gateway. The caller should patch the corresponding gateway. Returns false when no change was performed.
101102func prepareGatewayConditionUpdate (gw * gwv1.Gateway , targetConditionType string , newStatus metav1.ConditionStatus , reason string , message string ) bool {
102-
103103 indxToUpdate := - 1
104104 var derivedCondition metav1.Condition
105105 for i , condition := range gw .Status .Conditions {
@@ -114,7 +114,7 @@ func prepareGatewayConditionUpdate(gw *gwv1.Gateway, targetConditionType string,
114114 truncatedMessage := truncateMessage (message )
115115
116116 if indxToUpdate != - 1 {
117- if derivedCondition .Status != newStatus || derivedCondition .Message != truncatedMessage || derivedCondition .Reason != reason {
117+ if derivedCondition .Status != newStatus || derivedCondition .Message != truncatedMessage || derivedCondition .Reason != reason || derivedCondition . ObservedGeneration != gw . Generation {
118118 gw .Status .Conditions [indxToUpdate ].LastTransitionTime = metav1 .NewTime (time .Now ())
119119 gw .Status .Conditions [indxToUpdate ].ObservedGeneration = gw .Generation
120120 gw .Status .Conditions [indxToUpdate ].Status = newStatus
0 commit comments