@@ -307,8 +307,26 @@ func (p *RouteStatusProcessor) computeBackendTLSPolicyStatus(route client.Object
307
307
)
308
308
309
309
ancestorStatus := psu .StatusUpdateFor (routeParentRef )
310
- hostname := string (policy .Spec .Validation .Hostname )
311
310
311
+ defer func () {
312
+ p .statusUpdater .Send (status.Update {
313
+ Resource : psu .GetResource (),
314
+ NamespacedName : psu .GetFullName (),
315
+ Mutator : psu ,
316
+ })
317
+ }()
318
+
319
+ if policy .Spec .Validation .WellKnownCACertificates != nil && * policy .Spec .Validation .WellKnownCACertificates != "" {
320
+ ancestorStatus .AddCondition (
321
+ gwv1alpha2 .PolicyConditionAccepted ,
322
+ metav1 .ConditionFalse ,
323
+ gwv1alpha2 .PolicyReasonInvalid ,
324
+ ".spec.validation.wellKnownCACertificates is unsupported." ,
325
+ )
326
+ return
327
+ }
328
+
329
+ hostname := string (policy .Spec .Validation .Hostname )
312
330
if err := gwutils .IsValidHostname (hostname ); err != nil {
313
331
ancestorStatus .AddCondition (
314
332
gwv1alpha2 .PolicyConditionAccepted ,
@@ -351,12 +369,6 @@ func (p *RouteStatusProcessor) computeBackendTLSPolicyStatus(route client.Object
351
369
fmt .Sprintf ("Policy is accepted for ancestor %s/%s" , gwutils .NamespaceDerefOr (routeParentRef .Namespace , route .GetNamespace ()), routeParentRef .Name ),
352
370
)
353
371
}
354
-
355
- p .statusUpdater .Send (status.Update {
356
- Resource : psu .GetResource (),
357
- NamespacedName : psu .GetFullName (),
358
- Mutator : psu ,
359
- })
360
372
}
361
373
362
374
func (p * RouteStatusProcessor ) computeBackendLBPolicyStatus (route client.Object , backendRef gwv1.BackendObjectReference , _ * fgwv2.ServicePortName , routeParentRef gwv1.ParentReference ) {
@@ -380,6 +392,13 @@ func (p *RouteStatusProcessor) computeBackendLBPolicyStatus(route client.Object,
380
392
)
381
393
382
394
ancestorStatus := psu .StatusUpdateFor (routeParentRef )
395
+ defer func () {
396
+ p .statusUpdater .Send (status.Update {
397
+ Resource : psu .GetResource (),
398
+ NamespacedName : psu .GetFullName (),
399
+ Mutator : psu ,
400
+ })
401
+ }()
383
402
384
403
if ! ancestorStatus .ConditionExists (gwv1alpha2 .PolicyConditionAccepted ) {
385
404
ancestorStatus .AddCondition (
@@ -389,12 +408,6 @@ func (p *RouteStatusProcessor) computeBackendLBPolicyStatus(route client.Object,
389
408
fmt .Sprintf ("Policy is accepted for ancestor %s/%s" , gwutils .NamespaceDerefOr (routeParentRef .Namespace , route .GetNamespace ()), routeParentRef .Name ),
390
409
)
391
410
}
392
-
393
- p .statusUpdater .Send (status.Update {
394
- Resource : psu .GetResource (),
395
- NamespacedName : psu .GetFullName (),
396
- Mutator : psu ,
397
- })
398
411
}
399
412
400
413
func (p * RouteStatusProcessor ) computeHealthCheckPolicyStatus (route client.Object , backendRef gwv1.BackendObjectReference , svcPort * fgwv2.ServicePortName , routeParentRef gwv1.ParentReference ) {
@@ -419,6 +432,13 @@ func (p *RouteStatusProcessor) computeHealthCheckPolicyStatus(route client.Objec
419
432
)
420
433
421
434
ancestorStatus := psu .StatusUpdateFor (routeParentRef )
435
+ defer func () {
436
+ p .statusUpdater .Send (status.Update {
437
+ Resource : psu .GetResource (),
438
+ NamespacedName : psu .GetFullName (),
439
+ Mutator : psu ,
440
+ })
441
+ }()
422
442
423
443
if gwutils .HasAccessToBackendTargetRef (p .client , policy , targetRef , ancestorStatus ) {
424
444
ancestorStatus .AddCondition (
@@ -428,12 +448,6 @@ func (p *RouteStatusProcessor) computeHealthCheckPolicyStatus(route client.Objec
428
448
fmt .Sprintf ("Policy is accepted for ancestor %s/%s" , gwutils .NamespaceDerefOr (routeParentRef .Namespace , route .GetNamespace ()), routeParentRef .Name ),
429
449
)
430
450
}
431
-
432
- p .statusUpdater .Send (status.Update {
433
- Resource : psu .GetResource (),
434
- NamespacedName : psu .GetFullName (),
435
- Mutator : psu ,
436
- })
437
451
}
438
452
439
453
func (p * RouteStatusProcessor ) computeRetryPolicyStatus (route client.Object , backendRef gwv1.BackendObjectReference , svcPort * fgwv2.ServicePortName , routeParentRef gwv1.ParentReference ) {
@@ -458,6 +472,13 @@ func (p *RouteStatusProcessor) computeRetryPolicyStatus(route client.Object, bac
458
472
)
459
473
460
474
ancestorStatus := psu .StatusUpdateFor (routeParentRef )
475
+ defer func () {
476
+ p .statusUpdater .Send (status.Update {
477
+ Resource : psu .GetResource (),
478
+ NamespacedName : psu .GetFullName (),
479
+ Mutator : psu ,
480
+ })
481
+ }()
461
482
462
483
if gwutils .HasAccessToBackendTargetRef (p .client , policy , targetRef , ancestorStatus ) {
463
484
ancestorStatus .AddCondition (
@@ -467,12 +488,6 @@ func (p *RouteStatusProcessor) computeRetryPolicyStatus(route client.Object, bac
467
488
fmt .Sprintf ("Policy is accepted for ancestor %s/%s" , gwutils .NamespaceDerefOr (routeParentRef .Namespace , route .GetNamespace ()), routeParentRef .Name ),
468
489
)
469
490
}
470
-
471
- p .statusUpdater .Send (status.Update {
472
- Resource : psu .GetResource (),
473
- NamespacedName : psu .GetFullName (),
474
- Mutator : psu ,
475
- })
476
491
}
477
492
478
493
func (p * RouteStatusProcessor ) backendRefToServicePortName (route client.Object , backendRef gwv1.BackendObjectReference , rps status.RouteParentStatusObject ) * fgwv2.ServicePortName {
0 commit comments