Skip to content

Commit f6828fb

Browse files
committed
Conditions
1 parent bcca2bc commit f6828fb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/proposals/gateway-settings.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ type GatewaySettingsSpec struct {
7979
type Telemetry struct {
8080
// Exporter specifies OpenTelemetry export parameters.
8181
// +optional
82-
Exporter *Exporter `json:"exporter,omitempty"`
82+
Exporter *TelemetryExporter `json:"exporter,omitempty"`
8383

8484
// ServiceName is the "service.name" attribute of the OpenTelemetry resource.
8585
// Default is 'nginx-gateway-fabric:<gateway-name>'.
@@ -91,8 +91,8 @@ type Telemetry struct {
9191
SpanAttributes map[string]string `json:"spanAttributes,omitempty"`
9292
}
9393

94-
// Exporter specifies OpenTelemetry export parameters.
95-
type Exporter struct {
94+
// TelemetryExporter specifies OpenTelemetry export parameters.
95+
type TelemetryExporter struct {
9696
// Interval is the maximum interval between two exports, by default is 5 seconds.
9797
// +optional
9898
Interval *Duration `json:"interval,omitempty"`
@@ -122,7 +122,7 @@ type Duration string
122122

123123
> Note: This is subject to change, will not merge until ironed out.
124124
125-
In order to be consistent with other resources with object refs, we should add the `ResolvedRefs` Condition to the `GatewayClass` when the `parametersRef` is in use. If the `GatewaySettings` config is invalid, then the condition is set to `False` with a reason why.
125+
There are two Conditions on the GatewayClass status to consider when using the `parametersRef`. The first is a `ResolvedRefs` Condition. If the `GatewaySettings` reference cannot be found, then this Condition is set to `False`.
126126

127127
NGINX Gateway Fabric must set this Condition on the GatewayClass affected by a `GatewaySettings`.
128128
Below is an example of what this Condition may look like:
@@ -142,6 +142,12 @@ Some additional rules:
142142
- When the `GatewaySettings` affecting that object is removed, the Condition should be removed.
143143
- The Observed Generation is the generation of the GatewayClass, not the generation of the `GatewaySettings`.
144144

145+
The other condition is the existing `Accepted` condition on the GatewayClass. There is an existing reason for this Condition, `InvalidParameters`, that sets `Accepted` to `False` when the `parametersRef` fields are invalid. However, this could lead to downstream problems. For example, if a GatewayClass is `Accepted`, and then `GatewaySettings` are updated to something invalid, then marking the GatewayClass as `not Accepted` would result in the entire downstream configuration tree being nullified. This is a large disruption.
146+
147+
The proposition is to instead keep the GatewayClass as `Accepted` even if the `GatewaySettings` are invalid, but still set the reason to `InvalidParameters` and include a detailed message about the issue. In this case, default values will be reverted to for the settings, and downstream configuration will remain intact. There may be impact by reverting to defaults, but this impact is likely less than the impact of completely nullifying all Gateways/Routes/etc. that live under the GatewayClass if we instead marked it as `not Accepted`.
148+
149+
If this scenario occurs, we must be clear about what happened. Log an error, an event, and write the status.
150+
145151
## Use Cases
146152

147153
- As a Cluster Operator, I want to set global settings that will apply to all Gateways that are a part of a GatewayClass. These settings should not be overriden at a lower level.

0 commit comments

Comments
 (0)