From 6aa8352bb52f49d4cc740f271284f7b2d24d26f8 Mon Sep 17 00:00:00 2001 From: Kensei Nakada Date: Thu, 4 Jul 2024 11:32:33 +0900 Subject: [PATCH] chore: update the function name --- internal/gatewayapi/status/gateway.go | 6 +++--- internal/gatewayapi/status/gateway_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/gatewayapi/status/gateway.go b/internal/gatewayapi/status/gateway.go index 8db4c282aac6..0edafae24758 100644 --- a/internal/gatewayapi/status/gateway.go +++ b/internal/gatewayapi/status/gateway.go @@ -98,7 +98,7 @@ func UpdateGatewayStatusProgrammedCondition(gw *gwapiv1.Gateway, svc *corev1.Ser } // Update the programmed condition. - computeGatewayProgrammedCondition(gw, deployment) + updateGatewayProgrammedCondition(gw, deployment) } func SetGatewayListenerStatusCondition(gateway *gwapiv1.Gateway, listenerStatusIdx int, @@ -136,9 +136,9 @@ const ( messageFmtProgrammed = "Address assigned to the Gateway, %d/%d envoy Deployment replicas available" ) -// computeGatewayProgrammedCondition computes the Gateway Programmed status condition. +// updateGatewayProgrammedCondition computes the Gateway Programmed status condition. // Programmed condition surfaces true when the Envoy Deployment status is ready. -func computeGatewayProgrammedCondition(gw *gwapiv1.Gateway, deployment *appsv1.Deployment) { +func updateGatewayProgrammedCondition(gw *gwapiv1.Gateway, deployment *appsv1.Deployment) { if len(gw.Status.Addresses) == 0 { gw.Status.Conditions = MergeConditions(gw.Status.Conditions, newCondition(string(gwapiv1.GatewayConditionProgrammed), metav1.ConditionFalse, string(gwapiv1.GatewayReasonAddressNotAssigned), diff --git a/internal/gatewayapi/status/gateway_test.go b/internal/gatewayapi/status/gateway_test.go index 0bd822d095e1..0be99b7d4bf4 100644 --- a/internal/gatewayapi/status/gateway_test.go +++ b/internal/gatewayapi/status/gateway_test.go @@ -187,7 +187,7 @@ func TestUpdateGatewayStatusProgrammedCondition(t *testing.T) { } } -func TestGatewayReadyCondition(t *testing.T) { +func TestUpdateGatewayProgrammedCondition(t *testing.T) { testCases := []struct { name string // serviceAddressNum indicates how many addresses are set in the Gateway status. @@ -263,7 +263,7 @@ func TestGatewayReadyCondition(t *testing.T) { } deployment := &appsv1.Deployment{Status: tc.deploymentStatus} - computeGatewayProgrammedCondition(gtw, deployment) + updateGatewayProgrammedCondition(gtw, deployment) if d := cmp.Diff(tc.expectCondition, gtw.Status.Conditions, cmpopts.IgnoreFields(metav1.Condition{}, "LastTransitionTime")); d != "" { t.Errorf("unexpected condition diff: %s", d)