Skip to content

Commit 7cb5f72

Browse files
authored
treat too many addresses as programmed (#7542)
Signed-off-by: cong <[email protected]>
1 parent 36a23a6 commit 7cb5f72

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

internal/gatewayapi/status/gateway.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func SetGatewayListenerStatusCondition(gateway *gwapiv1.Gateway, listenerStatusI
149149

150150
const (
151151
messageAddressNotAssigned = "No addresses have been assigned to the Gateway"
152-
messageFmtTooManyAddresses = "Too many addresses (%d) have been assigned to the Gateway, the maximum number of addresses is 16"
152+
messageFmtTooManyAddresses = "Too many addresses (%d) have been assigned to the Gateway; only the first 16 are included in the status."
153153
messageNoResources = "Envoy replicas unavailable"
154154
messageFmtProgrammed = "Address assigned to the Gateway, %d/%d envoy replicas available"
155155
)
@@ -166,7 +166,7 @@ func updateGatewayProgrammedCondition(gw *gwapiv1.Gateway, envoyObj client.Objec
166166

167167
if len(gw.Status.Addresses) > 16 {
168168
gw.Status.Conditions = MergeConditions(gw.Status.Conditions,
169-
newCondition(string(gwapiv1.GatewayConditionProgrammed), metav1.ConditionFalse, string(gwapiv1.GatewayReasonInvalid),
169+
newCondition(string(gwapiv1.GatewayConditionProgrammed), metav1.ConditionTrue, string(gwapiv1.GatewayReasonProgrammed),
170170
fmt.Sprintf(messageFmtTooManyAddresses, len(gw.Status.Addresses)), gw.Generation))
171171

172172
// Truncate the addresses to 16

internal/gatewayapi/status/gateway_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,14 @@ func TestUpdateGatewayProgrammedCondition(t *testing.T) {
377377
},
378378
},
379379
{
380-
name: "not ready gateway with too many addresses",
380+
name: "ready gateway with too many addresses",
381381
serviceAddressNum: 17,
382382
deploymentStatus: appsv1.DeploymentStatus{AvailableReplicas: 1},
383383
expectCondition: []metav1.Condition{
384384
{
385385
Type: string(gwapiv1.GatewayConditionProgrammed),
386-
Status: metav1.ConditionFalse,
387-
Reason: string(gwapiv1.GatewayReasonInvalid),
386+
Status: metav1.ConditionTrue,
387+
Reason: string(gwapiv1.GatewayReasonProgrammed),
388388
Message: fmt.Sprintf(messageFmtTooManyAddresses, 17),
389389
},
390390
},

0 commit comments

Comments
 (0)