Documentation
¶
Index ¶
- Constants
- func ConvertConditions(conds []Condition, observedGeneration int64, transitionTime metav1.Time) []metav1.Condition
- func HasMatchingCondition(existingConditions []Condition, cond Condition) bool
- type Condition
- func DeduplicateConditions(conds []Condition) []Condition
- func NewClientSettingsPolicyAffected() Condition
- func NewDefaultGatewayClassConditions() []Condition
- func NewDefaultGatewayConditions() []Condition
- func NewDefaultListenerConditions(existingConditions []Condition) []Condition
- func NewDefaultRouteConditions() []Condition
- func NewGatewayAccepted() Condition
- func NewGatewayAcceptedListenersNotValid() Condition
- func NewGatewayClassConflict() Condition
- func NewGatewayClassInvalidParameters(msg string) Condition
- func NewGatewayClassRefInvalid(msg string) Condition
- func NewGatewayClassRefNotFound() Condition
- func NewGatewayClassResolvedRefs() Condition
- func NewGatewayClassSupportedVersionBestEffort(recommendedVersion string) []Condition
- func NewGatewayClassUnsupportedVersion(recommendedVersion string) []Condition
- func NewGatewayInvalid(msg string) []Condition
- func NewGatewayInvalidParameters(msg string) Condition
- func NewGatewayNotAcceptedListenersNotValid() []Condition
- func NewGatewayNotProgrammedInvalid(msg string) Condition
- func NewGatewayProgrammed() Condition
- func NewGatewayRefInvalid(msg string) Condition
- func NewGatewayRefNotFound() Condition
- func NewGatewayResolvedRefs() Condition
- func NewGatewayUnsupportedValue(msg string) []Condition
- func NewListenerAccepted() Condition
- func NewListenerHostnameConflict(msg string) []Condition
- func NewListenerInvalidCertificateRef(msg string) []Condition
- func NewListenerInvalidRouteKinds(msg string) []Condition
- func NewListenerNoConflicts() Condition
- func NewListenerNotProgrammedInvalid(msg string) Condition
- func NewListenerOverlappingTLSConfig(reason v1.ListenerConditionReason, msg string) Condition
- func NewListenerProgrammed() Condition
- func NewListenerProtocolConflict(msg string) []Condition
- func NewListenerRefNotPermitted(msg string) []Condition
- func NewListenerResolvedRefs() Condition
- func NewListenerUnsupportedProtocol(msg string) []Condition
- func NewListenerUnsupportedValue(msg string) []Condition
- func NewNginxGatewayInvalid(msg string) Condition
- func NewNginxGatewayValid() Condition
- func NewObservabilityPolicyAffected() Condition
- func NewPolicyAccepted() Condition
- func NewPolicyConflicted(msg string) Condition
- func NewPolicyInvalid(msg string) Condition
- func NewPolicyNotAcceptedNginxProxyNotSet(msg string) Condition
- func NewPolicyNotAcceptedTargetConflict(msg string) Condition
- func NewPolicyTargetNotFound(msg string) Condition
- func NewRouteAccepted() Condition
- func NewRouteBackendRefInvalidKind(msg string) Condition
- func NewRouteBackendRefRefBackendNotFound(msg string) Condition
- func NewRouteBackendRefRefNotPermitted(msg string) Condition
- func NewRouteBackendRefUnsupportedProtocol(msg string) Condition
- func NewRouteBackendRefUnsupportedValue(msg string) Condition
- func NewRouteHostnameConflict() Condition
- func NewRouteInvalidGateway() Condition
- func NewRouteInvalidIPFamily(msg string) Condition
- func NewRouteInvalidListener() Condition
- func NewRouteNoMatchingListenerHostname() Condition
- func NewRouteNoMatchingParent() Condition
- func NewRouteNotAllowedByListeners() Condition
- func NewRoutePartiallyInvalid(msg string) Condition
- func NewRouteResolvedRefs() Condition
- func NewRouteResolvedRefsInvalidFilter(msg string) Condition
- func NewRouteUnsupportedConfiguration(msg string) Condition
- func NewRouteUnsupportedValue(msg string) Condition
- func NewSnippetsFilterAccepted() Condition
- func NewSnippetsFilterInvalid(msg string) Condition
Constants ¶
const ( // GatewayClassReasonGatewayClassConflict indicates there are multiple GatewayClass resources // that reference this controller, and we ignored the resource in question and picked the // GatewayClass that is referenced in the command-line argument. // This reason is used with GatewayClassConditionAccepted (false). GatewayClassReasonGatewayClassConflict v1.GatewayClassConditionReason = "GatewayClassConflict" // GatewayClassMessageGatewayClassConflict is a message that describes GatewayClassReasonGatewayClassConflict. GatewayClassMessageGatewayClassConflict = "The resource is ignored due to a conflicting GatewayClass resource" // ListenerReasonUnsupportedValue is used with the "Accepted" condition when a value of a field in a Listener // is invalid or not supported. ListenerReasonUnsupportedValue v1.ListenerConditionReason = "UnsupportedValue" // ListenerMessageFailedNginxReload is a message used with ListenerConditionProgrammed (false) // when nginx fails to reload. ListenerMessageFailedNginxReload = "The Listener is not programmed due to a failure to " + "reload nginx with the configuration" // ListenerMessageOverlappingHostnames is a message used with the "OverlappingTLSConfig" condition when the // condition is true due to overlapping hostnames. ListenerMessageOverlappingHostnames = "Listener hostname overlaps with hostname(s) of other Listener(s) " + "on the same port" // RouteReasonBackendRefUnsupportedValue is used with the "ResolvedRefs" condition when one of the // Route rules has a backendRef with an unsupported value. RouteReasonBackendRefUnsupportedValue v1.RouteConditionReason = "UnsupportedValue" // RouteReasonInvalidGateway is used with the "Accepted" (false) condition when the Gateway the Route // references is invalid. RouteReasonInvalidGateway v1.RouteConditionReason = "InvalidGateway" // RouteReasonInvalidListener is used with the "Accepted" condition when the Route references an invalid listener. RouteReasonInvalidListener v1.RouteConditionReason = "InvalidListener" // RouteReasonHostnameConflict is used with the "Accepted" condition when a route has the exact same hostname // as another route. RouteReasonHostnameConflict v1.RouteConditionReason = "HostnameConflict" // RouteReasonUnsupportedConfiguration is used when the associated Gateway does not support the Route. // Used with Accepted (false). RouteReasonUnsupportedConfiguration v1.RouteConditionReason = "UnsupportedConfiguration" // RouteReasonInvalidIPFamily is used when the Service associated with the Route is not configured with // the same IP family as the NGINX server. // Used with ResolvedRefs (false). RouteReasonInvalidIPFamily v1.RouteConditionReason = "InvalidServiceIPFamily" // RouteReasonInvalidFilter is used when an extension ref filter referenced by a Route cannot be resolved, or is // invalid. Used with ResolvedRefs (false). RouteReasonInvalidFilter v1.RouteConditionReason = "InvalidFilter" // GatewayReasonUnsupportedValue is used with GatewayConditionAccepted (false) when a value of a field in a Gateway // is invalid or not supported. GatewayReasonUnsupportedValue v1.GatewayConditionReason = "UnsupportedValue" // GatewayMessageFailedNginxReload is a message used with GatewayConditionProgrammed (false) // when nginx fails to reload. GatewayMessageFailedNginxReload = "The Gateway is not programmed due to a failure to " + "reload nginx with the configuration" // RouteMessageFailedNginxReload is a message used with RouteReasonGatewayNotProgrammed // when nginx fails to reload. RouteMessageFailedNginxReload = GatewayMessageFailedNginxReload + ". NGINX may still be configured " + "for this Route. However, future updates to this resource will not be configured until the Gateway " + "is programmed again" // GatewayClassResolvedRefs condition indicates whether the controller was able to resolve the // parametersRef on the GatewayClass. GatewayClassResolvedRefs v1.GatewayClassConditionType = "ResolvedRefs" // GatewayClassReasonResolvedRefs is used with the "GatewayClassResolvedRefs" condition when the condition is true. GatewayClassReasonResolvedRefs v1.GatewayClassConditionReason = "ResolvedRefs" // GatewayClassReasonParamsRefNotFound is used with the "GatewayClassResolvedRefs" condition when the // parametersRef resource does not exist. GatewayClassReasonParamsRefNotFound v1.GatewayClassConditionReason = "ParametersRefNotFound" // GatewayClassReasonParamsRefInvalid is used with the "GatewayClassResolvedRefs" condition when the // parametersRef resource is invalid. GatewayClassReasonParamsRefInvalid v1.GatewayClassConditionReason = "ParametersRefInvalid" // PolicyReasonNginxProxyConfigNotSet is used with the "PolicyAccepted" condition when the // NginxProxy resource is missing or invalid. PolicyReasonNginxProxyConfigNotSet v1alpha2.PolicyConditionReason = "NginxProxyConfigNotSet" // PolicyMessageNginxProxyInvalid is a message used with the PolicyReasonNginxProxyConfigNotSet reason // when the NginxProxy resource is either invalid or not attached. PolicyMessageNginxProxyInvalid = "The NginxProxy configuration is either invalid or not attached to the GatewayClass" // PolicyMessageTelemetryNotEnabled is a message used with the PolicyReasonNginxProxyConfigNotSet reason // when telemetry is not enabled in the NginxProxy resource. PolicyMessageTelemetryNotEnabled = "Telemetry is not enabled in the NginxProxy resource" // PolicyReasonTargetConflict is used with the "PolicyAccepted" condition when a Route that it targets // has an overlapping hostname:port/path combination with another Route. PolicyReasonTargetConflict v1alpha2.PolicyConditionReason = "TargetConflict" // ClientSettingsPolicyAffected is used with the "PolicyAffected" condition when a // ClientSettingsPolicy is applied to a Gateway, HTTPRoute, or GRPCRoute. ClientSettingsPolicyAffected v1alpha2.PolicyConditionType = "ClientSettingsPolicyAffected" // ObservabilityPolicyAffected is used with the "PolicyAffected" condition when an // ObservabilityPolicy is applied to a HTTPRoute, or GRPCRoute. ObservabilityPolicyAffected v1alpha2.PolicyConditionType = "ObservabilityPolicyAffected" // PolicyAffectedReason is used with the "PolicyAffected" condition when a // ObservabilityPolicy or ClientSettingsPolicy is applied to Gateways or Routes. PolicyAffectedReason v1alpha2.PolicyConditionReason = "PolicyAffected" // GatewayResolvedRefs condition indicates whether the controller was able to resolve the // parametersRef on the Gateway. GatewayResolvedRefs v1.GatewayConditionType = "ResolvedRefs" // GatewayReasonResolvedRefs is used with the "GatewayResolvedRefs" condition when the condition is true. GatewayReasonResolvedRefs v1.GatewayConditionReason = "ResolvedRefs" // GatewayReasonParamsRefNotFound is used with the "GatewayResolvedRefs" condition when the // parametersRef resource does not exist. GatewayReasonParamsRefNotFound v1.GatewayConditionReason = "ParametersRefNotFound" // GatewayReasonParamsRefInvalid is used with the "GatewayResolvedRefs" condition when the // parametersRef resource is invalid. GatewayReasonParamsRefInvalid v1.GatewayConditionReason = "ParametersRefInvalid" )
Variables ¶
This section is empty.
Functions ¶
func ConvertConditions ¶
func ConvertConditions( conds []Condition, observedGeneration int64, transitionTime metav1.Time, ) []metav1.Condition
ConvertConditions converts conditions to Kubernetes API conditions.
func HasMatchingCondition ¶
HasMatchingCondition checks if the given condition matches any of the existing conditions.
Types ¶
type Condition ¶
type Condition struct { Type string Status metav1.ConditionStatus Reason string Message string }
Condition defines a condition to be reported in the status of resources.
func DeduplicateConditions ¶
DeduplicateConditions removes duplicate conditions based on the condition type. The last condition wins. The order of conditions is preserved.
func NewClientSettingsPolicyAffected ¶
func NewClientSettingsPolicyAffected() Condition
NewClientSettingsPolicyAffected returns a Condition that indicates that a ClientSettingsPolicy is applied to the resource.
func NewDefaultGatewayClassConditions ¶
func NewDefaultGatewayClassConditions() []Condition
NewDefaultGatewayClassConditions returns Conditions that indicate that the GatewayClass is accepted and that the Gateway API CRD versions are supported.
func NewDefaultGatewayConditions ¶
func NewDefaultGatewayConditions() []Condition
NewDefaultGatewayConditions returns the default Conditions that must be present in the status of a Gateway.
func NewDefaultListenerConditions ¶
NewDefaultListenerConditions returns the default Conditions that must be present in the status of a Listener. If existingConditions contains conflict-related conditions (like OverlappingTLSConfig or Conflicted), the NoConflicts condition is excluded to avoid conflicting condition states.
func NewDefaultRouteConditions ¶
func NewDefaultRouteConditions() []Condition
NewDefaultRouteConditions returns the default conditions that must be present in the status of a Route.
func NewGatewayAccepted ¶
func NewGatewayAccepted() Condition
NewGatewayAccepted returns a Condition that indicates the Gateway is accepted.
func NewGatewayAcceptedListenersNotValid ¶
func NewGatewayAcceptedListenersNotValid() Condition
NewGatewayAcceptedListenersNotValid returns a Condition that indicates the Gateway is accepted, but has at least one listener that is invalid.
func NewGatewayClassConflict ¶
func NewGatewayClassConflict() Condition
NewGatewayClassConflict returns a Condition that indicates that the GatewayClass is not accepted due to a conflict with another GatewayClass.
func NewGatewayClassInvalidParameters ¶
NewGatewayClassInvalidParameters returns a Condition that indicates that the GatewayClass has invalid parameters. We are allowing Accepted to still be true to prevent nullifying the entire config tree if a parametersRef is updated to something invalid.
func NewGatewayClassRefInvalid ¶
NewGatewayClassRefInvalid returns a Condition that indicates that the parametersRef on the GatewayClass could not be resolved because the resource it references is invalid.
func NewGatewayClassRefNotFound ¶
func NewGatewayClassRefNotFound() Condition
NewGatewayClassRefNotFound returns a Condition that indicates that the parametersRef on the GatewayClass could not be resolved.
func NewGatewayClassResolvedRefs ¶
func NewGatewayClassResolvedRefs() Condition
NewGatewayClassResolvedRefs returns a Condition that indicates that the parametersRef on the GatewayClass is resolved.
func NewGatewayClassSupportedVersionBestEffort ¶
NewGatewayClassSupportedVersionBestEffort returns a Condition that indicates that the GatewayClass is accepted, but the Gateway API CRD versions are not supported. This means NGF will attempt to generate configuration, but it does not guarantee support.
func NewGatewayClassUnsupportedVersion ¶
NewGatewayClassUnsupportedVersion returns Conditions that indicate that the GatewayClass is not accepted because the Gateway API CRD versions are not supported. NGF will not generate configuration in this case.
func NewGatewayInvalid ¶
NewGatewayInvalid returns Conditions that indicate the Gateway is not accepted and programmed because it is semantically or syntactically invalid. The provided message contains the details of why the Gateway is invalid.
func NewGatewayInvalidParameters ¶
NewGatewayInvalidParameters returns a Condition that indicates that the Gateway has invalid parameters. We are allowing Accepted to still be true to prevent nullifying the entire Gateway config if a parametersRef is updated to something invalid.
func NewGatewayNotAcceptedListenersNotValid ¶
func NewGatewayNotAcceptedListenersNotValid() []Condition
NewGatewayNotAcceptedListenersNotValid returns Conditions that indicate the Gateway is not accepted, because all listeners are invalid.
func NewGatewayNotProgrammedInvalid ¶
NewGatewayNotProgrammedInvalid returns a Condition that indicates the Gateway is not programmed because it is semantically or syntactically invalid. The provided message contains the details of why the Gateway is invalid.
func NewGatewayProgrammed ¶
func NewGatewayProgrammed() Condition
NewGatewayProgrammed returns a Condition that indicates the Gateway is programmed.
func NewGatewayRefInvalid ¶
NewGatewayRefInvalid returns a Condition that indicates that the parametersRef on the Gateway could not be resolved because the referenced resource is invalid.
func NewGatewayRefNotFound ¶
func NewGatewayRefNotFound() Condition
NewGatewayRefNotFound returns a Condition that indicates that the parametersRef on the Gateway could not be resolved.
func NewGatewayResolvedRefs ¶
func NewGatewayResolvedRefs() Condition
NewGatewayResolvedRefs returns a Condition that indicates that the parametersRef on the Gateway is resolved.
func NewGatewayUnsupportedValue ¶
NewGatewayUnsupportedValue returns Conditions that indicate that a field of the Gateway has an unsupported value. Unsupported means that the value is not supported by the implementation or invalid.
func NewListenerAccepted ¶
func NewListenerAccepted() Condition
NewListenerAccepted returns a Condition that indicates that the Listener is accepted.
func NewListenerHostnameConflict ¶
NewListenerHostnameConflict returns Conditions that indicate multiple Listeners are specified with the same Listener port, but are HTTPS and TLS and have overlapping hostnames.
func NewListenerInvalidCertificateRef ¶
NewListenerInvalidCertificateRef returns Conditions that indicate that a CertificateRef of a Listener is invalid.
func NewListenerInvalidRouteKinds ¶
NewListenerInvalidRouteKinds returns Conditions that indicate that an invalid or unsupported Route kind is specified by the Listener.
func NewListenerNoConflicts ¶
func NewListenerNoConflicts() Condition
NewListenerNoConflicts returns a Condition that indicates that there are no conflicts in a Listener.
func NewListenerNotProgrammedInvalid ¶
NewListenerNotProgrammedInvalid returns a Condition that indicates the Listener is not programmed because it is semantically or syntactically invalid. The provided message contains the details of why the Listener is invalid.
func NewListenerOverlappingTLSConfig ¶
func NewListenerOverlappingTLSConfig(reason v1.ListenerConditionReason, msg string) Condition
NewListenerOverlappingTLSConfig returns a Condition that indicates overlapping TLS configuration between Listeners on the same port.
func NewListenerProgrammed ¶
func NewListenerProgrammed() Condition
NewListenerProgrammed returns a Condition that indicates the Listener is programmed.
func NewListenerProtocolConflict ¶
NewListenerProtocolConflict returns Conditions that indicate multiple Listeners are specified with the same Listener port number, but have conflicting protocol specifications.
func NewListenerRefNotPermitted ¶
NewListenerRefNotPermitted returns Conditions that indicates that the Listener references a TLS secret that is not permitted by a ReferenceGrant.
func NewListenerResolvedRefs ¶
func NewListenerResolvedRefs() Condition
NewListenerResolvedRefs returns a Condition that indicates that all references in a Listener are resolved.
func NewListenerUnsupportedProtocol ¶
NewListenerUnsupportedProtocol returns Conditions that indicate that the protocol of a Listener is unsupported.
func NewListenerUnsupportedValue ¶
NewListenerUnsupportedValue returns Conditions that indicate that a field of a Listener has an unsupported value. Unsupported means that the value is not supported by the implementation or invalid.
func NewNginxGatewayInvalid ¶
NewNginxGatewayInvalid returns a Condition that indicates that the NginxGateway config is invalid.
func NewNginxGatewayValid ¶
func NewNginxGatewayValid() Condition
NewNginxGatewayValid returns a Condition that indicates that the NginxGateway config is valid.
func NewObservabilityPolicyAffected ¶
func NewObservabilityPolicyAffected() Condition
NewObservabilityPolicyAffected returns a Condition that indicates that an ObservabilityPolicy is applied to the resource.
func NewPolicyAccepted ¶
func NewPolicyAccepted() Condition
NewPolicyAccepted returns a Condition that indicates that the Policy is accepted.
func NewPolicyConflicted ¶
NewPolicyConflicted returns a Condition that indicates that the Policy is not accepted because it conflicts with another Policy and a merge is not possible.
func NewPolicyInvalid ¶
NewPolicyInvalid returns a Condition that indicates that the Policy is not accepted because it is semantically or syntactically invalid.
func NewPolicyNotAcceptedNginxProxyNotSet ¶
NewPolicyNotAcceptedNginxProxyNotSet returns a Condition that indicates that the Policy is not accepted because it relies on the NginxProxy configuration which is missing or invalid.
func NewPolicyNotAcceptedTargetConflict ¶
NewPolicyNotAcceptedTargetConflict returns a Condition that indicates that the Policy is not accepted because the target resource has a conflict with another resource when attempting to apply this policy.
func NewPolicyTargetNotFound ¶
NewPolicyTargetNotFound returns a Condition that indicates that the Policy is not accepted because the target resource does not exist or can not be attached to.
func NewRouteAccepted ¶
func NewRouteAccepted() Condition
NewRouteAccepted returns a Condition that indicates that the Route is accepted.
func NewRouteBackendRefInvalidKind ¶
NewRouteBackendRefInvalidKind returns a Condition that indicates that the Route has a backendRef with an invalid kind.
func NewRouteBackendRefRefBackendNotFound ¶
NewRouteBackendRefRefBackendNotFound returns a Condition that indicates that the Route has a backendRef that points to non-existing backend.
func NewRouteBackendRefRefNotPermitted ¶
NewRouteBackendRefRefNotPermitted returns a Condition that indicates that the Route has a backendRef that is not permitted.
func NewRouteBackendRefUnsupportedProtocol ¶
NewRouteBackendRefUnsupportedProtocol returns a Condition that indicates that the Route has a backendRef with an unsupported protocol.
func NewRouteBackendRefUnsupportedValue ¶
NewRouteBackendRefUnsupportedValue returns a Condition that indicates that the Route has a backendRef with an unsupported value.
func NewRouteHostnameConflict ¶
func NewRouteHostnameConflict() Condition
NewRouteHostnameConflict returns a Condition that indicates that the Route is not accepted because of a conflicting hostname on the same port.
func NewRouteInvalidGateway ¶
func NewRouteInvalidGateway() Condition
NewRouteInvalidGateway returns a Condition that indicates that the Route is not Accepted because the Gateway it references is invalid.
func NewRouteInvalidIPFamily ¶
NewRouteInvalidIPFamily returns a Condition that indicates that the Service associated with the Route is not configured with the same IP family as the NGINX server.
func NewRouteInvalidListener ¶
func NewRouteInvalidListener() Condition
NewRouteInvalidListener returns a Condition that indicates that the Route is not accepted because of an invalid listener.
func NewRouteNoMatchingListenerHostname ¶
func NewRouteNoMatchingListenerHostname() Condition
NewRouteNoMatchingListenerHostname returns a Condition that indicates that the hostname of the listener does not match the hostnames of the Route.
func NewRouteNoMatchingParent ¶
func NewRouteNoMatchingParent() Condition
NewRouteNoMatchingParent returns a Condition that indicates that the Route is not Accepted because it specifies a Port and/or SectionName that does not match any Listeners in the Gateway.
func NewRouteNotAllowedByListeners ¶
func NewRouteNotAllowedByListeners() Condition
NewRouteNotAllowedByListeners returns a Condition that indicates that the Route is not allowed by any listener.
func NewRoutePartiallyInvalid ¶
NewRoutePartiallyInvalid returns a Condition that indicates that the Route contains a combination of both valid and invalid rules.
// nolint:lll The message must start with "Dropped Rules(s)" according to the Gateway API spec See https://github.com/kubernetes-sigs/gateway-api/blob/37d81593e5a965ed76582dbc1a2f56bbd57c0622/apis/v1/shared_types.go#L408-L413
func NewRouteResolvedRefs ¶
func NewRouteResolvedRefs() Condition
NewRouteResolvedRefs returns a Condition that indicates that all the references on the Route are resolved.
func NewRouteResolvedRefsInvalidFilter ¶
NewRouteResolvedRefsInvalidFilter returns a Condition that indicates that the Route has a filter that cannot be resolved or is invalid.
func NewRouteUnsupportedConfiguration ¶
NewRouteUnsupportedConfiguration returns a Condition that indicates that the Route is not Accepted because it is incompatible with the Gateway's configuration.
func NewRouteUnsupportedValue ¶
NewRouteUnsupportedValue returns a Condition that indicates that the Route includes an unsupported value.
func NewSnippetsFilterAccepted ¶
func NewSnippetsFilterAccepted() Condition
NewSnippetsFilterAccepted returns a Condition that indicates that the SnippetsFilter is accepted because it is valid.
func NewSnippetsFilterInvalid ¶
NewSnippetsFilterInvalid returns a Condition that indicates that the SnippetsFilter is not accepted because it is syntactically or semantically invalid.