@@ -12,6 +12,11 @@ const (
12
12
// is invalid or not supported.
13
13
ListenerReasonUnsupportedValue v1beta1.ListenerConditionReason = "UnsupportedValue"
14
14
15
+ // ListenerMessageFailedNginxReload is a message used with ListenerConditionProgrammed (false)
16
+ // when nginx fails to reload.
17
+ ListenerMessageFailedNginxReload = "The Listener is not programmed due to a failure to " +
18
+ "reload nginx with the configuration"
19
+
15
20
// RouteReasonBackendRefUnsupportedValue is used with the "ResolvedRefs" condition when one of the
16
21
// Route rules has a backendRef with an unsupported value.
17
22
RouteReasonBackendRefUnsupportedValue = "UnsupportedValue"
@@ -253,6 +258,7 @@ func NewRouteGatewayNotProgrammed(msg string) Condition {
253
258
func NewDefaultListenerConditions () []Condition {
254
259
return []Condition {
255
260
NewListenerAccepted (),
261
+ NewListenerProgrammed (),
256
262
NewListenerResolvedRefs (),
257
263
NewListenerNoConflicts (),
258
264
}
@@ -268,6 +274,16 @@ func NewListenerAccepted() Condition {
268
274
}
269
275
}
270
276
277
+ // NewListenerProgrammed returns a Condition that indicates the Listener is programmed.
278
+ func NewListenerProgrammed () Condition {
279
+ return Condition {
280
+ Type : string (v1beta1 .ListenerConditionProgrammed ),
281
+ Status : metav1 .ConditionTrue ,
282
+ Reason : string (v1beta1 .ListenerReasonProgrammed ),
283
+ Message : "Listener is programmed" ,
284
+ }
285
+ }
286
+
271
287
// NewListenerResolvedRefs returns a Condition that indicates that all references in a Listener are resolved.
272
288
func NewListenerResolvedRefs () Condition {
273
289
return Condition {
@@ -288,17 +304,31 @@ func NewListenerNoConflicts() Condition {
288
304
}
289
305
}
290
306
291
- // NewListenerUnsupportedValue returns a Condition that indicates that a field of a Listener has an unsupported value.
292
- // Unsupported means that the value is not supported by the implementation or invalid.
293
- func NewListenerUnsupportedValue (msg string ) Condition {
307
+ // NewListenerNotProgrammedInvalid returns a Condition that indicates the Listener is not programmed because it is
308
+ // semantically or syntactically invalid. The provided message contains the details of why the Listener is invalid.
309
+ func NewListenerNotProgrammedInvalid (msg string ) Condition {
294
310
return Condition {
295
- Type : string (v1beta1 .ListenerConditionAccepted ),
311
+ Type : string (v1beta1 .ListenerConditionProgrammed ),
296
312
Status : metav1 .ConditionFalse ,
297
- Reason : string (ListenerReasonUnsupportedValue ),
313
+ Reason : string (v1beta1 . ListenerReasonInvalid ),
298
314
Message : msg ,
299
315
}
300
316
}
301
317
318
+ // NewListenerUnsupportedValue returns Conditions that indicate that a field of a Listener has an unsupported value.
319
+ // Unsupported means that the value is not supported by the implementation or invalid.
320
+ func NewListenerUnsupportedValue (msg string ) []Condition {
321
+ return []Condition {
322
+ {
323
+ Type : string (v1beta1 .ListenerConditionAccepted ),
324
+ Status : metav1 .ConditionFalse ,
325
+ Reason : string (ListenerReasonUnsupportedValue ),
326
+ Message : msg ,
327
+ },
328
+ NewListenerNotProgrammedInvalid (msg ),
329
+ }
330
+ }
331
+
302
332
// NewListenerInvalidCertificateRef returns Conditions that indicate that a CertificateRef of a Listener is invalid.
303
333
func NewListenerInvalidCertificateRef (msg string ) []Condition {
304
334
return []Condition {
@@ -314,6 +344,7 @@ func NewListenerInvalidCertificateRef(msg string) []Condition {
314
344
Reason : string (v1beta1 .ListenerReasonInvalidCertificateRef ),
315
345
Message : msg ,
316
346
},
347
+ NewListenerNotProgrammedInvalid (msg ),
317
348
}
318
349
}
319
350
@@ -333,16 +364,20 @@ func NewListenerProtocolConflict(msg string) []Condition {
333
364
Reason : string (v1beta1 .ListenerReasonProtocolConflict ),
334
365
Message : msg ,
335
366
},
367
+ NewListenerNotProgrammedInvalid (msg ),
336
368
}
337
369
}
338
370
339
- // NewListenerUnsupportedProtocol returns a Condition that indicates that the protocol of a Listener is unsupported.
340
- func NewListenerUnsupportedProtocol (msg string ) Condition {
341
- return Condition {
342
- Type : string (v1beta1 .ListenerConditionAccepted ),
343
- Status : metav1 .ConditionFalse ,
344
- Reason : string (v1beta1 .ListenerReasonUnsupportedProtocol ),
345
- Message : msg ,
371
+ // NewListenerUnsupportedProtocol returns Conditions that indicate that the protocol of a Listener is unsupported.
372
+ func NewListenerUnsupportedProtocol (msg string ) []Condition {
373
+ return []Condition {
374
+ {
375
+ Type : string (v1beta1 .ListenerConditionAccepted ),
376
+ Status : metav1 .ConditionFalse ,
377
+ Reason : string (v1beta1 .ListenerReasonUnsupportedProtocol ),
378
+ Message : msg ,
379
+ },
380
+ NewListenerNotProgrammedInvalid (msg ),
346
381
}
347
382
}
348
383
@@ -368,7 +403,7 @@ func NewGatewayClassInvalidParameters(msg string) Condition {
368
403
}
369
404
}
370
405
371
- // NewDefaultGatewayConditions returns the default Condition that must be present in the status of a Gateway.
406
+ // NewDefaultGatewayConditions returns the default Conditions that must be present in the status of a Gateway.
372
407
func NewDefaultGatewayConditions () []Condition {
373
408
return []Condition {
374
409
NewGatewayAccepted (),
@@ -386,7 +421,7 @@ func NewGatewayAccepted() Condition {
386
421
}
387
422
}
388
423
389
- // NewGatewayConflict returns a Condition that indicates the Gateway has a conflict with another Gateway.
424
+ // NewGatewayConflict returns Conditions that indicate the Gateway has a conflict with another Gateway.
390
425
func NewGatewayConflict () []Condition {
391
426
return []Condition {
392
427
{
@@ -410,7 +445,7 @@ func NewGatewayAcceptedListenersNotValid() Condition {
410
445
}
411
446
}
412
447
413
- // NewGatewayNotAcceptedListenersNotValid returns a Condition that indicates the Gateway is not accepted,
448
+ // NewGatewayNotAcceptedListenersNotValid returns Conditions that indicate the Gateway is not accepted,
414
449
// because all listeners are invalid.
415
450
func NewGatewayNotAcceptedListenersNotValid () []Condition {
416
451
msg := "Gateway has no valid listeners"
@@ -425,7 +460,7 @@ func NewGatewayNotAcceptedListenersNotValid() []Condition {
425
460
}
426
461
}
427
462
428
- // NewGatewayInvalid returns a Condition that indicates the Gateway is not accepted and programmed because it is
463
+ // NewGatewayInvalid returns Conditions that indicate the Gateway is not accepted and programmed because it is
429
464
// semantically or syntactically invalid. The provided message contains the details of why the Gateway is invalid.
430
465
func NewGatewayInvalid (msg string ) []Condition {
431
466
return []Condition {
@@ -439,7 +474,7 @@ func NewGatewayInvalid(msg string) []Condition {
439
474
}
440
475
}
441
476
442
- // NewGatewayUnsupportedValue returns a Condition that indicates that a field of the Gateway has an unsupported value.
477
+ // NewGatewayUnsupportedValue returns Conditions that indicate that a field of the Gateway has an unsupported value.
443
478
// Unsupported means that the value is not supported by the implementation or invalid.
444
479
func NewGatewayUnsupportedValue (msg string ) []Condition {
445
480
return []Condition {
0 commit comments