@@ -12,6 +12,11 @@ const (
1212 // is invalid or not supported.
1313 ListenerReasonUnsupportedValue v1beta1.ListenerConditionReason = "UnsupportedValue"
1414
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+
1520 // RouteReasonBackendRefUnsupportedValue is used with the "ResolvedRefs" condition when one of the
1621 // Route rules has a backendRef with an unsupported value.
1722 RouteReasonBackendRefUnsupportedValue = "UnsupportedValue"
@@ -253,6 +258,7 @@ func NewRouteGatewayNotProgrammed(msg string) Condition {
253258func NewDefaultListenerConditions () []Condition {
254259 return []Condition {
255260 NewListenerAccepted (),
261+ NewListenerProgrammed (),
256262 NewListenerResolvedRefs (),
257263 NewListenerNoConflicts (),
258264 }
@@ -268,6 +274,16 @@ func NewListenerAccepted() Condition {
268274 }
269275}
270276
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+
271287// NewListenerResolvedRefs returns a Condition that indicates that all references in a Listener are resolved.
272288func NewListenerResolvedRefs () Condition {
273289 return Condition {
@@ -288,17 +304,31 @@ func NewListenerNoConflicts() Condition {
288304 }
289305}
290306
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 {
294310 return Condition {
295- Type : string (v1beta1 .ListenerConditionAccepted ),
311+ Type : string (v1beta1 .ListenerConditionProgrammed ),
296312 Status : metav1 .ConditionFalse ,
297- Reason : string (ListenerReasonUnsupportedValue ),
313+ Reason : string (v1beta1 . ListenerReasonInvalid ),
298314 Message : msg ,
299315 }
300316}
301317
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+
302332// NewListenerInvalidCertificateRef returns Conditions that indicate that a CertificateRef of a Listener is invalid.
303333func NewListenerInvalidCertificateRef (msg string ) []Condition {
304334 return []Condition {
@@ -314,6 +344,7 @@ func NewListenerInvalidCertificateRef(msg string) []Condition {
314344 Reason : string (v1beta1 .ListenerReasonInvalidCertificateRef ),
315345 Message : msg ,
316346 },
347+ NewListenerNotProgrammedInvalid (msg ),
317348 }
318349}
319350
@@ -333,16 +364,20 @@ func NewListenerProtocolConflict(msg string) []Condition {
333364 Reason : string (v1beta1 .ListenerReasonProtocolConflict ),
334365 Message : msg ,
335366 },
367+ NewListenerNotProgrammedInvalid (msg ),
336368 }
337369}
338370
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 ),
346381 }
347382}
348383
@@ -368,7 +403,7 @@ func NewGatewayClassInvalidParameters(msg string) Condition {
368403 }
369404}
370405
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.
372407func NewDefaultGatewayConditions () []Condition {
373408 return []Condition {
374409 NewGatewayAccepted (),
@@ -386,7 +421,7 @@ func NewGatewayAccepted() Condition {
386421 }
387422}
388423
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.
390425func NewGatewayConflict () []Condition {
391426 return []Condition {
392427 {
@@ -410,7 +445,7 @@ func NewGatewayAcceptedListenersNotValid() Condition {
410445 }
411446}
412447
413- // NewGatewayNotAcceptedListenersNotValid returns a Condition that indicates the Gateway is not accepted,
448+ // NewGatewayNotAcceptedListenersNotValid returns Conditions that indicate the Gateway is not accepted,
414449// because all listeners are invalid.
415450func NewGatewayNotAcceptedListenersNotValid () []Condition {
416451 msg := "Gateway has no valid listeners"
@@ -425,7 +460,7 @@ func NewGatewayNotAcceptedListenersNotValid() []Condition {
425460 }
426461}
427462
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
429464// semantically or syntactically invalid. The provided message contains the details of why the Gateway is invalid.
430465func NewGatewayInvalid (msg string ) []Condition {
431466 return []Condition {
@@ -439,7 +474,7 @@ func NewGatewayInvalid(msg string) []Condition {
439474 }
440475}
441476
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.
443478// Unsupported means that the value is not supported by the implementation or invalid.
444479func NewGatewayUnsupportedValue (msg string ) []Condition {
445480 return []Condition {
0 commit comments