|
6 | 6 | "strconv" |
7 | 7 |
|
8 | 8 | "k8s.io/apimachinery/pkg/api/errors" |
9 | | - "k8s.io/apimachinery/pkg/api/meta" |
10 | | - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
11 | 9 | "k8s.io/apimachinery/pkg/types" |
12 | 10 | ctrl "sigs.k8s.io/controller-runtime" |
13 | 11 | "sigs.k8s.io/controller-runtime/pkg/client" |
@@ -154,48 +152,15 @@ func (r *GatewayReconciler) extractEnvoyListeners(gw *gatewayv1.Gateway) []*envo |
154 | 152 | return listeners |
155 | 153 | } |
156 | 154 |
|
157 | | -// updateGatewayStatus updates the Gateway status with conditions based on the Proxy state. |
| 155 | +// updateGatewayStatus updates the Gateway status based on the Proxy state. |
| 156 | +// Note: Gateway status conditions (Accepted, Programmed) are now managed by the |
| 157 | +// apiserver's status runner which subscribes to translation pipeline status updates. |
| 158 | +// This function is kept for potential future health-check based status updates. |
158 | 159 | func (r *GatewayReconciler) updateGatewayStatus(ctx context.Context, gw *gatewayv1.Gateway, proxy *corev1alpha2.Proxy) error { |
159 | | - acceptedCondition := metav1.Condition{ |
160 | | - Type: string(gwapiv1.GatewayConditionAccepted), |
161 | | - Status: metav1.ConditionTrue, |
162 | | - ObservedGeneration: gw.Generation, |
163 | | - LastTransitionTime: metav1.Now(), |
164 | | - Reason: string(gwapiv1.GatewayReasonAccepted), |
165 | | - Message: "Gateway accepted and associated with Proxy", |
166 | | - } |
167 | | - |
168 | | - programmedCondition := metav1.Condition{ |
169 | | - Type: string(gwapiv1.GatewayConditionProgrammed), |
170 | | - Status: metav1.ConditionTrue, |
171 | | - ObservedGeneration: gw.Generation, |
172 | | - LastTransitionTime: metav1.Now(), |
173 | | - Reason: string(gwapiv1.GatewayReasonProgrammed), |
174 | | - Message: "Gateway listeners are configured in Envoy", |
175 | | - } |
176 | | - |
177 | | - meta.SetStatusCondition(&gw.Status.Conditions, acceptedCondition) |
178 | | - meta.SetStatusCondition(&gw.Status.Conditions, programmedCondition) |
179 | | - |
180 | | - for i, l := range gw.Spec.Listeners { |
181 | | - if i < len(gw.Status.Listeners) { |
182 | | - gw.Status.Listeners[i].Name = l.Name |
183 | | - gw.Status.Listeners[i].AttachedRoutes = 0 // This would need route counting logic |
184 | | - |
185 | | - // Set listener conditions |
186 | | - listenerAccepted := metav1.Condition{ |
187 | | - Type: string(gwapiv1.ListenerConditionAccepted), |
188 | | - Status: metav1.ConditionTrue, |
189 | | - ObservedGeneration: gw.Generation, |
190 | | - LastTransitionTime: metav1.Now(), |
191 | | - Reason: string(gwapiv1.ListenerReasonAccepted), |
192 | | - Message: "Listener accepted", |
193 | | - } |
194 | | - meta.SetStatusCondition(&gw.Status.Listeners[i].Conditions, listenerAccepted) |
195 | | - } |
196 | | - } |
197 | | - |
198 | | - return r.Status().Update(ctx, gw) |
| 160 | + // Status conditions are managed by the apiserver status runner. |
| 161 | + // The backplane should only update status based on health checks or |
| 162 | + // runtime information that isn't available at translation time. |
| 163 | + return nil |
199 | 164 | } |
200 | 165 |
|
201 | 166 | // SetupWithManager sets up the controller with the Manager. |
|
0 commit comments