Skip to content

Commit 82aac77

Browse files
committed
Fix gateway manifest
1 parent f2164da commit 82aac77

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

internal/controller/state/graph/gateway.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ func validateGateway(gw *v1.Gateway, gc *GatewayClass, npCfg *NginxProxy) ([]con
179179
conds = append(conds, conditions.NewGatewayInvalid("GatewayClass is invalid")...)
180180
}
181181

182+
// Set the unaccepted conditions here, because those make the gateway invalid. We set the unprogrammed conditions
183+
// elsewhere, because those do not make the gateway invalid.
182184
for _, address := range gw.Spec.Addresses {
183185
if address.Type == nil {
184186
conds = append(conds, conditions.NewGatewayUnsupportedAddress("AddressType must be specified"))

internal/controller/status/prepare_requests.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ func prepareGatewayRequest(
335335
)
336336
}
337337

338+
// Set the unprogrammed conditions here, because those do not make the gateway invalid.
339+
// We set the unaccepted conditions elsewhere, because those do make the gateway invalid.
338340
for _, address := range gateway.Source.Spec.Addresses {
339341
if address.Value == "" {
340342
gwConds = append(gwConds, conditions.NewGatewayAddressNotAssigned("Dynamically assigned addresses for the "+

tests/suite/manifests/upstream-settings-policy/invalid-target-usps.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ metadata:
55
spec:
66
gatewayClassName: nginx
77
addresses:
8-
- value: "10.0.0.1"
8+
- type: Hostname
9+
value: "foo"
910
listeners:
1011
- name: http
1112
port: 80

0 commit comments

Comments
 (0)