Skip to content

Commit b4a279b

Browse files
woodgearjukie
authored andcommitted
treat too many addresses as programmed (envoyproxy#7542)
Signed-off-by: cong <[email protected]> Signed-off-by: jukie <[email protected]>
1 parent 11b4585 commit b4a279b

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
@@ -151,7 +151,7 @@ func SetGatewayListenerStatusCondition(gateway *gwapiv1.Gateway, listenerStatusI
151151

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

169169
if len(gw.Status.Addresses) > 16 {
170170
gw.Status.Conditions = MergeConditions(gw.Status.Conditions,
171-
newCondition(string(gwapiv1.GatewayConditionProgrammed), metav1.ConditionFalse, string(gwapiv1.GatewayReasonInvalid),
171+
newCondition(string(gwapiv1.GatewayConditionProgrammed), metav1.ConditionTrue, string(gwapiv1.GatewayReasonProgrammed),
172172
fmt.Sprintf(messageFmtTooManyAddresses, len(gw.Status.Addresses)), time.Now(), gw.Generation))
173173

174174
// 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)